【问题标题】:Cloud Custodian Policies for EC2 and S3EC2 和 S3 的云托管策略
【发布时间】:2018-03-26 08:13:23
【问题描述】:

我正在编写云托管策略来终止所有面向互联网的 ec2 实例和公共 S3 存储桶。

我在官方文档中找不到直接的规则过滤器。

任何帮助将不胜感激。

干杯

【问题讨论】:

    标签: amazon-web-services cloudcustodian


    【解决方案1】:

    参考:Cloud Custodian Docs

    policies:
      - name: find-ec2-on-public-subnets
        resource: ec2
        filters:
            - type: value
              key: "SubnetId"
              op: in
              value:
                  - subnet-d1e4xxxxx
                  - subnet-d1e4xxxxx
        actions:
            - stop
    
      - name: s3-global-access
        resource: s3
        filters:
          - type: global-grants
        actions:
          - type: delete-global-grants
            grantees:
              - "http://acs.amazonaws.com/groups/global/AllUsers"
              - "http://acs.amazonaws.com/groups/global/AuthenticatedUsers"
    

    【讨论】:

      猜你喜欢
      • 2020-12-27
      • 2013-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-20
      • 1970-01-01
      • 2019-09-14
      • 1970-01-01
      相关资源
      最近更新 更多