2 個答案
- 最新
- 最多得票
- 最多評論
0
Yes I am trying to achieve this thing but I want to achieve this by using AWS SCP. All post which I have seen they all have same json file as mine. But while implementation it is not working.
已回答 2 年前
0
I guess you are trying to achieve something like this: https://aws.amazon.com/premiumsupport/knowledge-center/iam-policy-tags-deny/ (Sid: AllowRunInstancesWithRestrictions1)
Your policy can be modified as follow:
{
"Effect": "Deny",
"Action": [
"ec2: CreateTags",
"ec2: RunInstances"
],
"Resource": [
"arn:aws:ec2:*:*:instance/*",
"arn:aws:ec2:*:*:volume/*"
],
"Condition": {
"StringNotLike": {
"aws:RequestTag/cost_center": "?*"
}
}
}
已回答 2 年前
相關內容
- 已提問 6 個月前
- AWS 官方已更新 7 個月前
- AWS 官方已更新 2 年前
So what condition type you are using?
ForAllValues:StringEquals? Or StringNotLike?
I have used Both but no luck.
Can you also post the policy you use with StringNotLike to see if there is any other issue?
Your policy with
means all your new EC2 instances need to have a tag
environment
and the tag value must be exactlytrue
Is this what you expect and what you get?