Created an IAM policy that should restrict user to now to allow ec2 instance creation when tags value not met
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowToDescribeAll", "Effect": "Allow", "Action": [ "ec2:Describe*" ], "Resource": "" }, { "Sid": "AllowRunInstances", "Effect": "Allow", "Action": "ec2:RunInstances", "Resource": [ "arn:aws:ec2:::image/", "arn:aws:ec2:::snapshot/", "arn:aws:ec2:::subnet/", "arn:aws:ec2:::network-interface/", "arn:aws:ec2:::security-group/", "arn:aws:ec2:::key-pair/" ] }, { "Sid": "AllowRunInstancesWithRestrictions", "Effect": "Allow", "Action": [ "ec2:CreateVolume", "ec2:RunInstances" ], "Resource": [ "arn:aws:ec2:::volume/", "arn:aws:ec2:::instance/" ], "Condition": { "StringEquals": { "aws:RequestTag/shutdown": "true", "aws:RequestTag/terminate": "true" }, "ForAllValues:StringEquals": { "aws:TagKeys": [ "shutdown", "terminate" ] } } }, { "Sid": "AllowCreateTagsOnlyLaunching", "Effect": "Allow", "Action": [ "ec2:CreateTags" ], "Resource": [ "arn:aws:ec2:::volume/", "arn:aws:ec2:::instance/*" ], "Condition": { "StringEquals": { "ec2:CreateAction": "RunInstances" } } } ] }


