cleanup

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStackFailureReason

func GetStackFailureReason(ctx context.Context, client *cloudformation.Client, stackName string) (string, error)

Types

type CFNStackCleanup

type CFNStackCleanup struct {
	// contains filtered or unexported fields
}

func NewCFNStackCleanup

func NewCFNStackCleanup(cfnClient *cloudformation.Client, logger logr.Logger) *CFNStackCleanup

func (*CFNStackCleanup) DeleteStack

func (c *CFNStackCleanup) DeleteStack(ctx context.Context, stackName string) error

func (*CFNStackCleanup) ListArchitectureStacks

func (c *CFNStackCleanup) ListArchitectureStacks(ctx context.Context, input FilterInput) ([]string, error)

ListArchitectureStacks lists all the architecture stacks for a given cluster architecture stacks start with EKSHybridCI-Arch

func (*CFNStackCleanup) ListCredentialStacks

func (c *CFNStackCleanup) ListCredentialStacks(ctx context.Context, input FilterInput) ([]string, error)

ListCredentialStacks lists all the credential stacks for a given cluster credentials stacks start with EKSHybridCI but not EKSHybridCI-Arch

type EC2Cleaner

type EC2Cleaner struct {
	// contains filtered or unexported fields
}

func NewEC2Cleaner

func NewEC2Cleaner(ec2Client *ec2.Client, logger logr.Logger) *EC2Cleaner

func (*EC2Cleaner) DeleteInstances

func (e *EC2Cleaner) DeleteInstances(ctx context.Context, instanceIDs []string) error

func (*EC2Cleaner) DeleteKeyPair

func (e *EC2Cleaner) DeleteKeyPair(ctx context.Context, keyPairID string) error

func (*EC2Cleaner) ListKeyPairs

func (e *EC2Cleaner) ListKeyPairs(ctx context.Context, input FilterInput) ([]string, error)

func (*EC2Cleaner) ListTaggedInstances

func (e *EC2Cleaner) ListTaggedInstances(ctx context.Context, input FilterInput) ([]string, error)

type EKSClusterCleanup

type EKSClusterCleanup struct {
	// contains filtered or unexported fields
}

func NewEKSClusterCleanup

func NewEKSClusterCleanup(eksClient *eks.Client, logger logr.Logger) *EKSClusterCleanup

func (*EKSClusterCleanup) DeleteCluster

func (c *EKSClusterCleanup) DeleteCluster(ctx context.Context, clusterName string) error

func (*EKSClusterCleanup) ListEKSClusters

func (c *EKSClusterCleanup) ListEKSClusters(ctx context.Context, input FilterInput) ([]string, error)

type FilterInput

type FilterInput struct {
	ClusterName          string
	ClusterNamePrefix    string
	AllClusters          bool
	InstanceAgeThreshold time.Duration
	DryRun               bool
}

type IAMCleaner

type IAMCleaner struct {
	// contains filtered or unexported fields
}

func NewIAMCleaner

func NewIAMCleaner(iamClient *iam.Client, logger logr.Logger) *IAMCleaner

func (*IAMCleaner) DeleteInstanceProfile

func (c *IAMCleaner) DeleteInstanceProfile(ctx context.Context, profileName string) error

func (*IAMCleaner) DeleteRole

func (c *IAMCleaner) DeleteRole(ctx context.Context, roleName string) error

func (*IAMCleaner) ListInstanceProfiles

func (c *IAMCleaner) ListInstanceProfiles(ctx context.Context, filterInput FilterInput) ([]string, error)

func (*IAMCleaner) ListRoles

func (c *IAMCleaner) ListRoles(ctx context.Context, filterInput FilterInput) ([]string, error)

func (*IAMCleaner) ListRolesForInstanceProfile

func (c *IAMCleaner) ListRolesForInstanceProfile(ctx context.Context, profileName string) ([]string, error)

func (*IAMCleaner) RemoveRolesFromInstanceProfile

func (c *IAMCleaner) RemoveRolesFromInstanceProfile(ctx context.Context, roles []string, profileName string) error

type ResourceWithTags

type ResourceWithTags struct {
	ID           string
	CreationTime time.Time
	Tags         []Tag
}

type RolesAnywhereCleaner

type RolesAnywhereCleaner struct {
	// contains filtered or unexported fields
}

func NewRolesAnywhereCleaner

func NewRolesAnywhereCleaner(rolesAnywhere *rolesanywhere.Client, logger logr.Logger) *RolesAnywhereCleaner

func (*RolesAnywhereCleaner) DeleteProfile

func (c *RolesAnywhereCleaner) DeleteProfile(ctx context.Context, profileID string) error

func (*RolesAnywhereCleaner) DeleteTrustAnchor

func (c *RolesAnywhereCleaner) DeleteTrustAnchor(ctx context.Context, anchorID string) error

func (*RolesAnywhereCleaner) ListProfiles

func (c *RolesAnywhereCleaner) ListProfiles(ctx context.Context, filterInput FilterInput) ([]string, error)

func (*RolesAnywhereCleaner) ListTrustAnchors

func (c *RolesAnywhereCleaner) ListTrustAnchors(ctx context.Context, filterInput FilterInput) ([]string, error)

type S3Cleaner

type S3Cleaner struct {
	// contains filtered or unexported fields
}

func NewS3Cleaner

func NewS3Cleaner(s3Client *s3.Client, logger logr.Logger) *S3Cleaner

func (*S3Cleaner) DeleteBucket

func (s *S3Cleaner) DeleteBucket(ctx context.Context, bucketName string) error

func (*S3Cleaner) EmptyS3Bucket

func (s *S3Cleaner) EmptyS3Bucket(ctx context.Context, bucketName string) error

func (*S3Cleaner) ListBuckets

func (s *S3Cleaner) ListBuckets(ctx context.Context, filterInput FilterInput) ([]string, error)

type SSMCleaner

type SSMCleaner struct {
	// contains filtered or unexported fields
}

func NewSSMCleaner

func NewSSMCleaner(ssm *ssm.Client, logger logr.Logger) *SSMCleaner

func (*SSMCleaner) DeleteActivation

func (s *SSMCleaner) DeleteActivation(ctx context.Context, activationID string) error

func (*SSMCleaner) DeleteManagedInstance

func (s *SSMCleaner) DeleteManagedInstance(ctx context.Context, instanceID string) error

func (*SSMCleaner) DeleteParameter

func (s *SSMCleaner) DeleteParameter(ctx context.Context, parameterName string) error

func (*SSMCleaner) ListActivations

func (s *SSMCleaner) ListActivations(ctx context.Context, filterInput FilterInput) ([]string, error)

func (*SSMCleaner) ListActivationsForNode

func (s *SSMCleaner) ListActivationsForNode(ctx context.Context, nodeName, clusterName string) ([]string, error)

func (*SSMCleaner) ListManagedInstances

func (s *SSMCleaner) ListManagedInstances(ctx context.Context, filterInput FilterInput) ([]string, error)

func (*SSMCleaner) ListManagedInstancesByActivationID

func (s *SSMCleaner) ListManagedInstancesByActivationID(ctx context.Context, activationIDs ...string) ([]string, error)

func (*SSMCleaner) ListParameters

func (s *SSMCleaner) ListParameters(ctx context.Context, filterInput FilterInput) ([]string, error)

type Sweeper

type Sweeper struct {
	// contains filtered or unexported fields
}

func NewSweeper

func NewSweeper(aws aws.Config, logger logr.Logger, endpoint string) Sweeper

func (*Sweeper) Run

func (c *Sweeper) Run(ctx context.Context, input SweeperInput) error

type SweeperInput

type SweeperInput struct {
	AllClusters          bool          `yaml:"allClusters"`
	DryRun               bool          `yaml:"dryRun"`
	ClusterName          string        `yaml:"clusterName"`
	ClusterNamePrefix    string        `yaml:"clusterNamePrefix"`
	InstanceAgeThreshold time.Duration `yaml:"instanceAgeThreshold"`
}

type Tag

type Tag struct {
	Key   string
	Value string
}

type VPCCleaner

type VPCCleaner struct {
	// contains filtered or unexported fields
}

VPCCleaner is responsible for cleaning up AWS VPC resources

func NewVPCCleaner

func NewVPCCleaner(ec2Client *ec2.Client, logger logr.Logger) *VPCCleaner

NewVPCCleaner creates a new VPC cleaner

func (*VPCCleaner) DeleteInternetGateway

func (v *VPCCleaner) DeleteInternetGateway(ctx context.Context, igwID string) error

func (*VPCCleaner) DeleteNetworkInterface

func (v *VPCCleaner) DeleteNetworkInterface(ctx context.Context, networkInterfaceID string) error

func (*VPCCleaner) DeletePeeringConnection

func (v *VPCCleaner) DeletePeeringConnection(ctx context.Context, peeringConnectionID string) error

func (*VPCCleaner) DeleteRouteTable

func (v *VPCCleaner) DeleteRouteTable(ctx context.Context, routeTableID string) error

func (*VPCCleaner) DeleteSecurityGroup

func (v *VPCCleaner) DeleteSecurityGroup(ctx context.Context, securityGroupID string) error

func (*VPCCleaner) DeleteSubnet

func (v *VPCCleaner) DeleteSubnet(ctx context.Context, subnetID string) error

func (*VPCCleaner) DeleteVPC

func (v *VPCCleaner) DeleteVPC(ctx context.Context, vpcID string) error

func (*VPCCleaner) ListInternetGateways

func (v *VPCCleaner) ListInternetGateways(ctx context.Context, input FilterInput) ([]string, error)

func (*VPCCleaner) ListNetworkInterfaces

func (v *VPCCleaner) ListNetworkInterfaces(ctx context.Context, vpcID string) ([]string, error)

func (*VPCCleaner) ListPeeringConnections

func (v *VPCCleaner) ListPeeringConnections(ctx context.Context, input FilterInput) ([]string, error)

func (*VPCCleaner) ListRouteTables

func (v *VPCCleaner) ListRouteTables(ctx context.Context, input FilterInput) ([]string, error)

func (*VPCCleaner) ListSecurityGroups

func (v *VPCCleaner) ListSecurityGroups(ctx context.Context, input FilterInput) ([]string, error)

func (*VPCCleaner) ListSubnets

func (v *VPCCleaner) ListSubnets(ctx context.Context, input FilterInput) ([]string, error)

func (*VPCCleaner) ListVPCs

func (v *VPCCleaner) ListVPCs(ctx context.Context, input FilterInput) ([]string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL