Documentation ¶
Index ¶
- Constants
- Variables
- func DescribeDefaultSecurityGroups(svc ec2iface.EC2API) ([]string, error)
- func GetDefaultVpcId(vpc Vpc) (string, error)
- func GetEc2ServiceClient(region string) ec2iface.EC2API
- func GetEnabledRegions() ([]string, error)
- func GetTargetRegions(enabledRegions []string, selectedRegions []string, excludedRegions []string) ([]string, error)
- func IsNukeable(resourceType string, resourceTypes []string) bool
- func IsValidResourceType(resourceType string, allResourceTypes []string) bool
- func ListResourceTypes() []string
- func NukeAllResources(account *AwsAccountResources, regions []string) error
- func NukeDefaultSecurityGroupRules(sgs []DefaultSecurityGroup) error
- func NukeVpcs(vpcs []Vpc) error
- type AMIs
- type ASGroups
- type AwsAccountResources
- type AwsRegionResource
- type AwsResources
- type DBClusters
- type DBInstances
- type DefaultSecurityGroup
- type EBSVolumes
- type EC2Instances
- type ECSClusters
- type ECSServices
- type EIPAddresses
- type EKSClusters
- type ElbDeleteError
- type ImageAvailableError
- type LambdaDeleteError
- type LambdaFunctions
- type LaunchConfigs
- type LoadBalancers
- type LoadBalancersV2
- type RdsDeleteError
- type S3Bucket
- type S3Buckets
- func (bucket S3Buckets) MaxBatchSize() int
- func (bucket S3Buckets) MaxConcurrentGetSize() int
- func (bucket S3Buckets) Nuke(session *session.Session, identifiers []string) error
- func (bucket S3Buckets) ObjectMaxBatchSize() int
- func (bucket S3Buckets) ResourceIdentifiers() []string
- func (bucket S3Buckets) ResourceName() string
- type Snapshots
- type Vpc
Constants ¶
const AwsResourceExclusionTagKey = "cloud-nuke-excluded"
Variables ¶
var GovCloudRegions = []string{
"us-gov-east-1",
"us-gov-west-1",
}
GovCloudRegions contains all of the U.S. GovCloud regions. In accounts with GovCloud enabled, these are the only available regions.
var OptInNotRequiredRegions = []string{
"eu-north-1",
"ap-south-1",
"eu-west-3",
"eu-west-2",
"eu-west-1",
"ap-northeast-2",
"ap-northeast-1",
"sa-east-1",
"ca-central-1",
"ap-southeast-1",
"ap-southeast-2",
"eu-central-1",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2",
}
OptInNotRequiredRegions contains all regions that are enabled by default on new AWS accounts Beginning in Spring 2019, AWS requires new regions to be explicitly enabled See https://aws.amazon.com/blogs/security/setting-permissions-to-enable-accounts-for-upcoming-aws-regions/
Functions ¶
func DescribeDefaultSecurityGroups ¶ added in v0.1.8
func GetDefaultVpcId ¶ added in v0.1.8
func GetEc2ServiceClient ¶ added in v0.1.8
func GetEnabledRegions ¶ added in v0.1.8
GetEnabledRegions - Get all regions that are enabled (DescribeRegions excludes those not enabled by default)
func GetTargetRegions ¶ added in v0.1.11
func GetTargetRegions(enabledRegions []string, selectedRegions []string, excludedRegions []string) ([]string, error)
GetTargetRegions - Used enabled, selected and excluded regions to create a final list of valid regions
func IsNukeable ¶ added in v0.1.9
IsNukeable - Checks if we should nuke a resource or not
func IsValidResourceType ¶ added in v0.1.9
IsValidResourceType - Checks if a resourceType is valid or not
func ListResourceTypes ¶ added in v0.1.9
func ListResourceTypes() []string
ListResourceTypes - Returns list of resources which can be passed to --resource-type
func NukeAllResources ¶
func NukeAllResources(account *AwsAccountResources, regions []string) error
NukeAllResources - Nukes all aws resources
func NukeDefaultSecurityGroupRules ¶ added in v0.1.8
func NukeDefaultSecurityGroupRules(sgs []DefaultSecurityGroup) error
Types ¶
type AMIs ¶ added in v0.0.4
type AMIs struct {
ImageIds []string
}
AMIs - represents all user owned AMIs
func (AMIs) MaxBatchSize ¶ added in v0.1.2
func (AMIs) ResourceIdentifiers ¶ added in v0.0.4
ResourceIdentifiers - The AMI image ids
func (AMIs) ResourceName ¶ added in v0.0.4
ResourceName - the simple name of the aws resource
type ASGroups ¶
type ASGroups struct {
GroupNames []string
}
ASGroups - represents all auto scaling groups
func (ASGroups) MaxBatchSize ¶ added in v0.1.2
func (ASGroups) ResourceIdentifiers ¶
ResourceIdentifiers - The group names of the auto scaling groups
func (ASGroups) ResourceName ¶
ResourceName - the simple name of the aws resource
type AwsAccountResources ¶
type AwsAccountResources struct {
Resources map[string]AwsRegionResource
}
func GetAllResources ¶
func GetAllResources(targetRegions []string, excludeAfter time.Time, resourceTypes []string, configObj config.Config) (*AwsAccountResources, error)
GetAllResources - Lists all aws resources
type AwsRegionResource ¶
type AwsRegionResource struct {
Resources []AwsResources
}
type AwsResources ¶
type DBClusters ¶ added in v0.1.14
type DBClusters struct {
InstanceNames []string
}
func (DBClusters) MaxBatchSize ¶ added in v0.1.14
func (instance DBClusters) MaxBatchSize() int
func (DBClusters) Nuke ¶ added in v0.1.14
func (instance DBClusters) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (DBClusters) ResourceIdentifiers ¶ added in v0.1.14
func (instance DBClusters) ResourceIdentifiers() []string
ResourceIdentifiers - The instance names of the rds db instances
func (DBClusters) ResourceName ¶ added in v0.1.14
func (instance DBClusters) ResourceName() string
type DBInstances ¶ added in v0.1.14
type DBInstances struct {
InstanceNames []string
}
func (DBInstances) MaxBatchSize ¶ added in v0.1.14
func (instance DBInstances) MaxBatchSize() int
func (DBInstances) Nuke ¶ added in v0.1.14
func (instance DBInstances) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (DBInstances) ResourceIdentifiers ¶ added in v0.1.14
func (instance DBInstances) ResourceIdentifiers() []string
ResourceIdentifiers - The instance names of the rds db instances
func (DBInstances) ResourceName ¶ added in v0.1.14
func (instance DBInstances) ResourceName() string
type DefaultSecurityGroup ¶ added in v0.1.8
type DefaultSecurityGroup struct { GroupName string GroupId string Region string // contains filtered or unexported fields }
func GetDefaultSecurityGroups ¶ added in v0.1.8
func GetDefaultSecurityGroups(regions []string) ([]DefaultSecurityGroup, error)
type EBSVolumes ¶
type EBSVolumes struct {
VolumeIds []string
}
EBSVolumes - represents all ebs volumes
func (EBSVolumes) MaxBatchSize ¶ added in v0.1.2
func (volume EBSVolumes) MaxBatchSize() int
func (EBSVolumes) Nuke ¶
func (volume EBSVolumes) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (EBSVolumes) ResourceIdentifiers ¶
func (volume EBSVolumes) ResourceIdentifiers() []string
ResourceIdentifiers - The volume ids of the ebs volumes
func (EBSVolumes) ResourceName ¶
func (volume EBSVolumes) ResourceName() string
ResourceName - the simple name of the aws resource
type EC2Instances ¶
type EC2Instances struct {
InstanceIds []string
}
EC2Instances - represents all ec2 instances
func (EC2Instances) MaxBatchSize ¶ added in v0.1.2
func (instance EC2Instances) MaxBatchSize() int
func (EC2Instances) Nuke ¶
func (instance EC2Instances) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (EC2Instances) ResourceIdentifiers ¶
func (instance EC2Instances) ResourceIdentifiers() []string
ResourceIdentifiers - The instance ids of the ec2 instances
func (EC2Instances) ResourceName ¶
func (instance EC2Instances) ResourceName() string
ResourceName - the simple name of the aws resource
type ECSClusters ¶ added in v0.1.22
type ECSClusters struct {
ClusterArns []string
}
ECSClusters - Represents all ECS clusters found in a region
func (ECSClusters) MaxBatchSize ¶ added in v0.1.22
func (clusters ECSClusters) MaxBatchSize() int
func (ECSClusters) Nuke ¶ added in v0.1.22
func (clusters ECSClusters) Nuke(awsSession *session.Session, identifiers []string) error
Nuke - nuke all ECS Cluster resources
func (ECSClusters) ResourceIdentifiers ¶ added in v0.1.22
func (clusters ECSClusters) ResourceIdentifiers() []string
ResourceIdentifiers - the collected ECS clusters
func (ECSClusters) ResourceName ¶ added in v0.1.22
func (clusters ECSClusters) ResourceName() string
ResourceName - The simple name of the aws resource
type ECSServices ¶ added in v0.1.4
ECSServices - Represents all ECS services found in a region
func (ECSServices) MaxBatchSize ¶ added in v0.1.4
func (services ECSServices) MaxBatchSize() int
func (ECSServices) Nuke ¶ added in v0.1.4
func (services ECSServices) Nuke(awsSession *session.Session, identifiers []string) error
Nuke - nuke all ECS service resources
func (ECSServices) ResourceIdentifiers ¶ added in v0.1.4
func (services ECSServices) ResourceIdentifiers() []string
ResourceIdentifiers - The ARNs of the collected ECS services
func (ECSServices) ResourceName ¶ added in v0.1.4
func (services ECSServices) ResourceName() string
ResourceName - The simple name of the aws resource
type EIPAddresses ¶ added in v0.1.2
type EIPAddresses struct {
AllocationIds []string
}
EBSVolumes - represents all ebs volumes
func (EIPAddresses) MaxBatchSize ¶ added in v0.1.2
func (address EIPAddresses) MaxBatchSize() int
func (EIPAddresses) Nuke ¶ added in v0.1.2
func (address EIPAddresses) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (EIPAddresses) ResourceIdentifiers ¶ added in v0.1.2
func (address EIPAddresses) ResourceIdentifiers() []string
ResourceIdentifiers - The instance ids of the eip addresses
func (EIPAddresses) ResourceName ¶ added in v0.1.2
func (address EIPAddresses) ResourceName() string
ResourceName - the simple name of the aws resource
type EKSClusters ¶ added in v0.1.5
type EKSClusters struct {
Clusters []string
}
EKSClusters - Represents all EKS clusters found in a region
func (EKSClusters) MaxBatchSize ¶ added in v0.1.5
func (clusters EKSClusters) MaxBatchSize() int
func (EKSClusters) Nuke ¶ added in v0.1.5
func (clusters EKSClusters) Nuke(awsSession *session.Session, identifiers []string) error
Nuke - nuke all EKS Cluster resources
func (EKSClusters) ResourceIdentifiers ¶ added in v0.1.5
func (clusters EKSClusters) ResourceIdentifiers() []string
ResourceIdentifiers - The Name of the collected EKS clusters
func (EKSClusters) ResourceName ¶ added in v0.1.5
func (clusters EKSClusters) ResourceName() string
ResourceName - The simple name of the aws resource
type ElbDeleteError ¶
type ElbDeleteError struct{}
func (ElbDeleteError) Error ¶
func (e ElbDeleteError) Error() string
type ImageAvailableError ¶ added in v0.1.2
type ImageAvailableError struct{}
func (ImageAvailableError) Error ¶ added in v0.1.2
func (e ImageAvailableError) Error() string
type LambdaDeleteError ¶ added in v0.1.24
type LambdaDeleteError struct {
// contains filtered or unexported fields
}
func (LambdaDeleteError) Error ¶ added in v0.1.24
func (e LambdaDeleteError) Error() string
type LambdaFunctions ¶ added in v0.1.24
type LambdaFunctions struct {
LambdaFunctionNames []string
}
func (LambdaFunctions) MaxBatchSize ¶ added in v0.1.24
func (lambda LambdaFunctions) MaxBatchSize() int
func (LambdaFunctions) Nuke ¶ added in v0.1.24
func (lambda LambdaFunctions) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (LambdaFunctions) ResourceIdentifiers ¶ added in v0.1.24
func (lambda LambdaFunctions) ResourceIdentifiers() []string
ResourceIdentifiers - The names of the lambda functions
func (LambdaFunctions) ResourceName ¶ added in v0.1.24
func (lambda LambdaFunctions) ResourceName() string
type LaunchConfigs ¶ added in v0.1.3
type LaunchConfigs struct {
LaunchConfigurationNames []string
}
LaunchConfigs - represents all launch configurations
func (LaunchConfigs) MaxBatchSize ¶ added in v0.1.3
func (config LaunchConfigs) MaxBatchSize() int
func (LaunchConfigs) Nuke ¶ added in v0.1.3
func (config LaunchConfigs) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (LaunchConfigs) ResourceIdentifiers ¶ added in v0.1.3
func (config LaunchConfigs) ResourceIdentifiers() []string
ResourceIdentifiers - The names of the launch configurations
func (LaunchConfigs) ResourceName ¶ added in v0.1.3
func (config LaunchConfigs) ResourceName() string
ResourceName - the simple name of the aws resource
type LoadBalancers ¶
type LoadBalancers struct {
Names []string
}
LoadBalancers - represents all load balancers
func (LoadBalancers) MaxBatchSize ¶ added in v0.1.2
func (balancer LoadBalancers) MaxBatchSize() int
func (LoadBalancers) Nuke ¶
func (balancer LoadBalancers) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (LoadBalancers) ResourceIdentifiers ¶
func (balancer LoadBalancers) ResourceIdentifiers() []string
ResourceIdentifiers - The names of the load balancers
func (LoadBalancers) ResourceName ¶
func (balancer LoadBalancers) ResourceName() string
ResourceName - the simple name of the aws resource
type LoadBalancersV2 ¶
type LoadBalancersV2 struct {
Arns []string
}
LoadBalancersV2 - represents all load balancers
func (LoadBalancersV2) MaxBatchSize ¶ added in v0.1.2
func (balancer LoadBalancersV2) MaxBatchSize() int
func (LoadBalancersV2) Nuke ¶
func (balancer LoadBalancersV2) Nuke(session *session.Session, identifiers []string) error
Nuke - nuke 'em all!!!
func (LoadBalancersV2) ResourceIdentifiers ¶
func (balancer LoadBalancersV2) ResourceIdentifiers() []string
ResourceIdentifiers - The arns of the load balancers
func (LoadBalancersV2) ResourceName ¶
func (balancer LoadBalancersV2) ResourceName() string
ResourceName - the simple name of the aws resource
type RdsDeleteError ¶ added in v0.1.14
type RdsDeleteError struct {
// contains filtered or unexported fields
}
func (RdsDeleteError) Error ¶ added in v0.1.14
func (e RdsDeleteError) Error() string
type S3Bucket ¶ added in v0.1.18
type S3Bucket struct { Name string CreationDate time.Time Region string Tags []map[string]string Error error IsValid bool InvalidReason string }
S3Bucket - represents S3 bucket
type S3Buckets ¶ added in v0.1.17
type S3Buckets struct {
Names []string
}
S3Buckets - represents all S3 Buckets
func (S3Buckets) MaxBatchSize ¶ added in v0.1.17
MaxBatchSize decides how many S3 buckets to delete in one call.
func (S3Buckets) MaxConcurrentGetSize ¶ added in v0.1.18
MaxConcurrentGetSize decides how many S3 buckets to fetch in one call.
func (S3Buckets) ObjectMaxBatchSize ¶ added in v0.1.17
ObjectMaxBatchSize decides how many unique objects of an S3 bucket (object + version = unique object) to delete in one call.
func (S3Buckets) ResourceIdentifiers ¶ added in v0.1.17
ResourceIdentifiers - The names of the S3 buckets
func (S3Buckets) ResourceName ¶ added in v0.1.17
ResourceName - the simple name of the aws resource
type Snapshots ¶ added in v0.0.4
type Snapshots struct {
SnapshotIds []string
}
Snapshots - represents all user owned Snapshots
func (Snapshots) MaxBatchSize ¶ added in v0.1.2
func (Snapshots) ResourceIdentifiers ¶ added in v0.0.4
ResourceIdentifiers - The Snapshot snapshot ids
func (Snapshots) ResourceName ¶ added in v0.0.4
ResourceName - the simple name of the aws resource
type Vpc ¶ added in v0.1.8
func GetDefaultVpcs ¶ added in v0.1.8
GetDefaultVpcs needs a slice of vpcs that already have service clients and regions assigned, either via NewVpcPerRegion() (as in the CLI) or manually (as in the mock tests)
func NewVpcPerRegion ¶ added in v0.1.8
NewVpcPerRegion merely assigns a service client and region to a VPC object The CLI calls this, but the tests don't because the tests need to use a mocked service client.
Source Files ¶
- ami.go
- ami_types.go
- asg.go
- asg_types.go
- aws.go
- ebs.go
- ebs_types.go
- ec2.go
- ec2_types.go
- ecs_cluster.go
- ecs_cluster_types.go
- ecs_service.go
- ecs_service_types.go
- eip.go
- eip_types.go
- eks.go
- eks_types.go
- elb.go
- elb_types.go
- elbv2.go
- elbv2_types.go
- globals.go
- lambda.go
- lambda_types.go
- launch_config.go
- launch_config_types.go
- rds.go
- rds_cluster.go
- rds_cluster_types.go
- rds_types.go
- s3.go
- s3_types.go
- snapshot.go
- snapshot_types.go
- types.go