Thursday, 5 September 2013

How to hide instances in EC2 based on tag - using IAM?

How to hide instances in EC2 based on tag - using IAM?

I want to create a new user in IAM, and allow him to be able to create new
EC2 instances, but be able to view/administer only those instances that he
creates.
Is this possible with IAM?
This is the group policy I tried:
{
"Statement":
[
{
"Effect": "Allow",
"Action":
[
"ec2:DescribeImages",
"ec2:DescribeKeyPairs", "ec2:DescribeSecurityGroups",
"ec2:DescribeAvailabilityZones"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action":
[
"ec2:DescribeInstances","ec2:RunInstances", "ec2:TerminateInstances",
"ec2:StartInstances", "ec2:StopInstances",
"DescribeInstanceAttribute", "DescribeInstanceStatus"
],
"Resource": "*",
"Condition":
{
"StringEquals":
{
"ec2:ResourceTag/tag": "TheValueOfTheTag"
}
}
}
]
}

No comments:

Post a Comment