0

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

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

任何帮助,将不胜感激。

干杯

4

1 回答 1

1

参考:云托管文档

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"
于 2018-03-26T10:33:46.233 回答