Please help me understand condition keys

0

Dear Experts,

I am using below post as reference. If you look at the reference, i can clearly see multiple attributes (if they are called attributes) mentioned in the condition keys column, but the poster is saying " At this time, there isn't a way to restrict "ModifyInstanceAttribute" to specific condition or resource. The action "ModifyInstanceAttribute" does not support any resource level permissions or any condition keys.

https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonec2.html "

But i can clearly see options in the condition key column. What am i missing here?

已提問 9 個月前檢視次數 193 次
2 個答案
0

Hi,

ec2:ModifyInstanceAttribute does support the conditions stated in the link you posted. Here's also an example of a valid policy using conditions

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "VisualEditor0",
			"Effect": "Allow",
			"Action": "ec2:ModifyInstanceAttribute",
			"Resource": "arn:aws:ec2:*:111111111111:instance/*",
			"Condition": {
				"StringEqualsIfExists": {
					"aws:ResourceTag/example": "works"
				}
			}
		}
	]
}

Could you elaborate what you mean by

the poster is saying " At this time, there isn't a way to restrict "ModifyInstanceAttribute" to specific condition or resource.

profile pictureAWS
專家
已回答 9 個月前
0

I am struggling to see if this is even possible

Everything I have looked at myself, says you cant create an IAM policy that matches DeleteOnTermination value of Modifyinstanceattribute

profile picture
專家
已回答 9 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南