我正在尝试删除aws帐户中的所有资源,但是aws的说明说我需要创建一个配置文件:
At first you need to create a configfile for aws-nuke. This is a minimal one:
regions:
- eu-west-1
- global
account-blacklist:
- "999999999999" # production
accounts:
"000000000000": {} # aws-nuke-example
With this config we can run aws-nuke:我的问题是,如何创建这个配置文件来删除与帐户相关的所有内容,并给我留下一个空白帐户?谢谢!
发布于 2022-03-16 15:28:25
如果你想要彻底核爆与一个帐户相关的一切,你只需要替换你想要擦除的帐号的零,就像在你的例子中一样。{}表示所有资源类型。保存文件as.YAML格式,然后发出如下命令:aws-nuke -c config/example.yaml --profile demo
在这里查看我的示例config/example.yaml文件:
regions:
#Regions where the resources are
- "global"
- "eu-central-1"
- "eu-west-1"
- "eu-west-2"
- "eu-east-1"
- "eu-east-2"
- "us-east-1"
- "us-east-2"
- "us-west-1"
- "us-west-2"
account-blocklist:
#Accounts you dont want to change
- 123456789101 # e.g production account
resource-types: #not mandatory
targets:
# Specific resources you want to remove
- S3Object
- S3Bucket
- EC2Volume
excludes: #not mandatory
# Specific resources you don't want to remove
- IAMUser
accounts:
943725333913: {}
# the {} means all resources associated with this account
# instead you can use filters like this:
943725333913:
filters:
S3Bucket:
- "s3://my-bucket"
S3Object:
- type: "glob"
value: "s3://my-bucket/*" https://stackoverflow.com/questions/61163390
复制相似问题