1 Answer
- Newest
- Most votes
- Most comments
0
The following policy ensures that only EC2 instances, volumes and snapshots will launched if they have an "application" key with any value except null value.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateVolume",
"ec2:RunInstances"
],
"Resource": [
"arn:aws:ec2:*::snapshot/*",
"arn:aws:ec2:*:*:instance/*",
"arn:aws:ec2:*:*:volume/*"
],
"Condition": {
"StringNotLike": {
"aws:RequestTag/application": "?*"
}
}
}
]
}
answered 4 years ago
Relevant content
- Accepted Answerasked 9 months ago
- asked 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 months ago
I tried to implement something almost exactly like this without luck. Are we sure this works?