【问题标题】:How to create a policy using scp in aws where it restricts user to create an instance without using tags如何在 aws 中使用 scp 创建策略,限制用户在不使用标签的情况下创建实例
【发布时间】:2022-01-03 23:43:52
【问题描述】:

需要使用 SCP 创建,允许用户仅在创建过程中创建标签时创建实例

【问题讨论】:

标签: amazon-web-services amazon-s3 amazon-ec2


【解决方案1】:

要限制在不使用特定标签的情况下创建新实例,您可以使用this statement

{
  "Sid": "DenyRunInstanceWithNoProjectTag",
  "Effect": "Deny",
  "Action": "ec2:RunInstances",
  "Resource": [
    "arn:aws:ec2:*:*:instance/*",
    "arn:aws:ec2:*:*:volume/*"
  ],
  "Condition": {
    "Null": {
      "aws:RequestTag/Project": "true"
    }
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-14
    • 1970-01-01
    • 1970-01-01
    • 2013-06-23
    • 1970-01-01
    相关资源
    最近更新 更多