Skip to content

Instantly share code, notes, and snippets.

@MrHassanMurtaza
Created January 30, 2020 08:47
Show Gist options
  • Save MrHassanMurtaza/78c0d4b143260a3a121e915dbfcd42f6 to your computer and use it in GitHub Desktop.
Save MrHassanMurtaza/78c0d4b143260a3a121e915dbfcd42f6 to your computer and use it in GitHub Desktop.
Deny_If_No_Purpose_Tag
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "NoPurposeTag",
"Effect": "Deny",
"Action": [
"ec2:RunInstances",
"ec2:CreateVolume"
],
"Condition": {
"ForAllValues:StringNotEquals": {
"aws:TagKeys": [
"Purpose"
]
}
},
"Resource": [
"arn:aws:ec2:*:*:volume/*",
"arn:aws:ec2:*:*:instance/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment