Last active
April 19, 2024 02:19
-
-
Save neilmcguigan/ede993d170ad3f51578bf2800276fbad to your computer and use it in GitHub Desktop.
cloudformation foreach loops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the key is to use &{foo} for resource identifiers, to strip out bad chars | |
Transform: AWS::LanguageExtensions | |
Parameters: | |
BucketNames: | |
Type: CommaDelimitedList | |
Resources: | |
# "for each bucketname in bucketnames..." | |
Fn::ForEach::Loop1: # the loop name doesn't matter, but must be unique in the template | |
- BucketName | |
- !Ref BucketNames | |
- "&{BucketName}": # the cloudformation logical resource id | |
Type: AWS::S3::Bucket | |
Properties: | |
BucketName: !Ref BucketName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment