0

我需要创建一个策略 IAM 来仅停止或终止具有特定标签(多个实例)的实例,我已经写了这个:

{
            "Action": [
                "ec2:StopInstances",
                "ec2:TerminateInstances"
            ],
            "Effect": "Allow",
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "ec2:ResourceTag/Name": "tag1",
                    "ec2:ResourceTag/Name": "tag2",
                    "ec2:ResourceTag/Name": "tag3"
                }
            }
        },

但是表格无效,只能ec2:ResourceTag/Name写一个字符串。如何停止和终止具有不同标签的实例Name

4

1 回答 1

1

尝试以下操作:

"Condition": {
  "StringEquals": {
    "ec2:ResourceTag/Name": ["tag1","tag2","tag3"]
  }
}
于 2015-09-29T14:43:34.383 回答