I nned an AWS IAM policy to prevent the creation of any resource whose name doesn’t comply with my company naming convention.
All resources names must end with -mySuffix
.
Basically, I need something like this:
“`json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "*:Create*",
"Resource": "*",
"Condition": {
"StringLike": {
"*:ResourceArn": "*-mySuffix"
}
}
}
]
}
Unfortunately, this doesn’t work… yet.
I tried with one JSON paragraph section per resource type (S3, SQS, Dynamodb, and so on), but it doesn’t work very reliably.