Documentation
¶
Overview ¶
Package aws implements AWS-specific cluster destroy cleanup for the clusterdelete package.
Index ¶
- type Options
- type Provider
- func (p *Provider) ClusterID() string
- func (p *Provider) ListTaggedInstances(ctx context.Context, managedOnly bool) ([]clusterdelete.Instance, error)
- func (p *Provider) Prepare(ctx context.Context, cfg *clusterconfig.ClusterConfig, outputs []byte) error
- func (p *Provider) RemainingManagedInstances(ctx context.Context) ([]clusterdelete.Instance, error)
- func (p *Provider) ScaleManagedGroupsToZero(ctx context.Context) error
- func (p *Provider) TerminateInstances(ctx context.Context, instances []clusterdelete.Instance) error
- func (p *Provider) WaitForManagedInstancesGone(ctx context.Context) error
- type ShardOutput
- type TFOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
ClusterID string
Bucket string
Region string
Profile string
ShardConfigs map[string]ShardOutput
WaitTimeout time.Duration
PollInterval time.Duration
}
Options contains AWS cleanup settings parsed from config and Terraform outputs.
func ParseOptions ¶
func ParseOptions(cfg *clusterconfig.ClusterConfig, outputs []byte) (*Options, error)
ParseOptions extracts AWS cleanup settings from cluster config and OpenTofu/Terraform output JSON.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider performs AWS-specific cluster delete cleanup.
func New ¶
New creates an AWS delete provider using the region and profile from the cluster provider config.
func (*Provider) ClusterID ¶
ClusterID returns the configured cluster ID for status messages and AWS tag filters.
func (*Provider) ListTaggedInstances ¶
func (p *Provider) ListTaggedInstances(ctx context.Context, managedOnly bool) ([]clusterdelete.Instance, error)
ListTaggedInstances lists EC2 instances tagged for the cluster, optionally limited to Nstance-managed instances.
func (*Provider) Prepare ¶
func (p *Provider) Prepare(ctx context.Context, cfg *clusterconfig.ClusterConfig, outputs []byte) error
Prepare parses Terraform outputs and stores the AWS cleanup options needed by subsequent provider operations.
func (*Provider) RemainingManagedInstances ¶
RemainingManagedInstances lists Nstance-managed EC2 instances still present after scale-down.
func (*Provider) ScaleManagedGroupsToZero ¶
ScaleManagedGroupsToZero updates each shard config in S3 so managed groups scale down before infrastructure destroy.
func (*Provider) TerminateInstances ¶
func (p *Provider) TerminateInstances(ctx context.Context, instances []clusterdelete.Instance) error
TerminateInstances directly terminates the supplied EC2 instances.
type ShardOutput ¶
type ShardOutput struct {
ConfigKey string `json:"config_key"`
ServerIPs []string `json:"server_ips"`
}
ShardOutput contains Terraform output metadata for one Nstance shard.
type TFOutput ¶
type TFOutput struct {
Sensitive bool `json:"sensitive"`
Type json.RawMessage `json:"type"`
Value json.RawMessage `json:"value"`
}
TFOutput represents one OpenTofu/Terraform JSON output entry.