I am trying to create an IAM user for the AWS Console with permission to list and perform action on only 1 instance.
So I have a total of 6 Instances and I tried hiding 5 of them via IAM Policies by adding the below policy:
Breakdown
1. First took all the permissions away
2. Added permission to only one instance
{
"Statement": [
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"condition": {}
}
},
{
"Effect": "Allow",
"Action": "*",
"Resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef",
"Condition": {
"condition": {}
}
}
]
}
This works for the 1st part only ie Denying to all Instances.
The 2nd part doesn't seem to work.
Don't the permissions work like that? Any help would be appreciated.