aws-nuke
aws-nuke copied to clipboard
Delete resources in all regions?
I'm looking to delete all the resources currently in my account regardless of region. Is there a way to delete resources in all regions without specifying each?
Hello @yosef-elementryx. There is no way to do it without specifying every region. You have to specify each one. See https://docs.aws.amazon.com/general/latest/gr/rande.html for a full list of regions.
@svenwltr Would this issue and or project in general be good for a GoLang newbie looking to contribute ? I'm keen.
Hello @wesgreentree, before we can judge the complexity, we need to agree on how the configuration file should look like. Generally it should not be that hard, since the AWS SDK contains a list of all regions somewhere.
@svenwltr Is anything on this page helpful ? https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/
This contains the mentioned list of regions, but we still need a proposal on how the aws-nuke config file should look like.
There will never be a region called "ALL", so just use that.
aws ec2 describe-regions --query "Regions[*].RegionName" --output text | xargs -n 1 | sort
regions:
- global
- ap-northeast-1
- ap-northeast-2
- ap-northeast-3
- ap-south-1
- ap-southeast-1
- ap-southeast-2
- ca-central-1
- eu-central-1
- eu-north-1
- eu-west-1
- eu-west-2
- eu-west-3
- sa-east-1
- us-east-1
- us-east-2
- us-west-1
- us-west-2
Update, as some regions were updated in the past 2 years
regions:
- global
- us-east-2
- us-east-1
- us-west-1
- us-west-2
- af-south-1
- ap-east-1
- ap-southeast-3
- ap-south-1
- ap-northeast-3
- ap-northeast-2
- ap-southeast-1
- ap-southeast-2
- ap-northeast-1
- ca-central-1
- cn-north-1
- cn-northwest-1
- eu-central-1
- eu-west-1
- eu-west-2
- eu-south-1
- eu-west-3
- eu-north-1
- me-south-1
- sa-east-1
It would be very beneficial to get this feature without actually having to generate this list all the time.
Hello, not sure what is blocking here, wouldn't a all-region: true
or regions: ["all"]
be fine for the config part? It looks like we are kind of maintaining a list of all regions in this issue while we could fetch it dynamically instead :)
We would have to care about disabled regions though if doing so
This is a sample AWS Nuke configuration file
Please refer to the documentation for more information:
https://github.com/rebuy-de/aws-nuke
AWS Nuke will only act on resources within the specified regions.
By default, if no regions are specified, AWS Nuke will not act on any resources.
regions:
- ap-south-1
- ap-northeast-3
- ap-northeast-2
- ap-southeast-1
- ap-southeast-2
- ap-northeast-1
- ca-central-1
- eu-central-1
- eu-west-1
- eu-west-2
- eu-west-3
- eu-north-1
- me-south-1
- sa-east-1
- us-east-1
- us-east-2
- us-west-1
- us-west-2
account-blocklist:
- "999999999999" # production
accounts: "<Account-id>": {} # aws-nuke-example
Updated list of regions as per today taken from here:
regions:
- global
- us-east-2
- us-east-1
- us-west-1
- us-west-2
- af-south-1
- ap-east-1
- ap-south-2
- ap-southeast-3
- ap-southeast-4
- ap-south-1
- ap-northeast-3
- ap-northeast-2
- ap-southeast-1
- ap-southeast-2
- ap-northeast-1
- ca-central-1
- ca-west-1
- eu-central-1
- eu-west-1
- eu-west-2
- eu-south-1
- eu-west-3
- eu-south-2
- eu-north-1
- eu-central-2
- il-central-1
- me-south-1
- me-central-1
- sa-east-1
- us-gov-east-1
- us-gov-west-1