In my CloudFormation template, I'm trying to create an S3 Bucket only if S3 doesn't already have a bucket that includes a certain keyword in it's name. For example, if my keyword is 'picture', I only want this S3 bucket to be created if no bucket in S3 contains the word 'picture' in its name.
"Resources": {
"myBucket": {
"Condition" : "<NO_S3_BUCKET_WITH_'picture'_IN_ITS_NAME_IN_THIS_ACCOUNT>",
"Type": "AWS::S3::Bucket",
"Properties": {
<SOME_PROPERTIES>
}
},
<OTHER_RESOURCES>
}
Is this possible? if so, can it be done with other AWS resources (CloudFront Distribution etc.)?