首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何生成aws配置文件

如何生成aws配置文件
EN

Stack Overflow用户
提问于 2020-04-11 20:37:45
回答 1查看 379关注 0票数 1

我正在尝试删除aws帐户中的所有资源,但是aws的说明说我需要创建一个配置文件:

代码语言:javascript
复制
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:

我的问题是,如何创建这个配置文件来删除与帐户相关的所有内容,并给我留下一个空白帐户?谢谢!

EN

回答 1

Stack Overflow用户

发布于 2022-03-16 15:28:25

如果你想要彻底核爆与一个帐户相关的一切,你只需要替换你想要擦除的帐号的零,就像在你的例子中一样。{}表示所有资源类型。保存文件as.YAML格式,然后发出如下命令:aws-nuke -c config/example.yaml --profile demo

在这里查看我的示例config/example.yaml文件:

代码语言:javascript
复制
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/*"          
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61163390

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档