I want to enter a list of cities as parameters to a SAM template. For Example: London, New York, Dubai. The list can have a large number of cities, say 50.
Using this list of cities, I want to create a log group pertaining to each city. For example:
How can I achieve this?
You can use Count Macro in Cloudformation.
AWSTemplateFormatVersion: "2010-09-09"
Transform: Count
Resources:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: /aws/ecs/%s
Count: ['Dubai','London','NewYork']
For more information check this question: How to loop through values in a CloudFormation template