I'm trying to create a IAM group that can fully access all resources that have certain tags.
For example, if an S3 bucket and an EC2 instance are tagged env:qa, the group project-qa should have full access to them.
So far I've tried the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
Effect: "Allow",
Action: "*",
Resource: "*",
Condition: {
"StringEquals": {
"aws:ResourceTag/env": "qa"
}
}
}
]
}
I created an account to test this, but when browsing buckets I was immediately told that I lack permissions for the s3:ListAllMyBuckets action - which I assumed would be covered by Action: "*"