Is it possible to exclude a volume from explicit deny in AWS IAM Policy
{
"Sid": "DenyCreationOfUnencryptedEBSVOL",
"Effect": "Deny",
"Action": "ec2:CreateVolume",
"Resource": "*",
"Condition": {
"Bool": {
"ec2:Encrypted": "false"
}
}
},
That block any volumes being created unencrypted.
Thinking that using a combination of conditions will allow only volumes with Name Value contained in the value anywhere in the value.
"Test_Unencrypted"
{
"Sid": "DenyCreationOfUnencryptedEBSVOL",
"Effect": "Deny",
"Action": "ec2:CreateVolume",
"Resource": "*",
"Condition": {
"Bool": {
"ec2:Encrypted": "false"
},
"StringNotLike": {
"aws:ResourceTag/Name":"*Test_Unencrypted*"
}
}
},
Is it possible to exclude single resource from deny like above?