我需要创建一个策略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
的实例
尝试如下:
"Condition": {
"StringEquals": {
"ec2:ResourceTag/Name": ["tag1","tag2","tag3"]
}
}