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년 전
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?