I am trying to create an IAM policy that gives users complete access to dynamodb with the caveat that the tables must have the tag Stage
with value Dev
on it. Basically you can create a table but you should add tag Stage
with value Dev
on it. You can view/update etc only those tables that have tag as Stage=Dev
.
AWS documentation mentions a way to do that easily using Global Context Keys: aws:ResourceTag
But when I use the visual editor I can't find the key in the list of context keys. If I manually edit the JSON and add the same, I am getting the warning condition key is not supported
Here is my policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "OnlyDynamoDBWithTagValueDev",
"Effect": "Allow",
"Action": "dynamodb:*",
"Resource": "arn:aws:dynamodb:*:accountnumber:table/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/Stage": "Dev"
}
}
}
]}
What I might be doing wrong here?