AWS just released required tag support for EC2/EBS: New – Tag EC2 Instances & EBS Volumes on Creation.
However, the example is given only checks if tags have a fixed value which isn't useful to us because our users can enter free form values for required tags. How can a policy be written to check tags are present?
For example, we need something like this:
"Statement": [
{
"Sid": "DenyMissingTags",
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:us-east-1:accountid:instance/*",
"Condition": {
"StringExists": [
"aws:RequestTag/costcenter",
"aws:RequestTag/stack",
]
}
}
]
Obviously, I made up StringExists