Reputation: 609
I have a cloudformation stack template that includes regional resources (lambdas, api, topics, etc.) and global resources (user, policies, route53, cloudfront, dynamodb global tables, etc.) and want to deploy it to multiple region in the same AWS account.
I can't directly deploy this stack template in multiple region because global resources will already exist after the first creation.
I know I could split everything in two separate stack templates but I would prefer to avoid this and keep everything in the same single stack template.
I saw that I could probably use CF Conditions + Parameters to toggle global resource creation only on first creation but that doesn't look very good...
I was wondering if I could leverage some CloudFormation feature like StackSets or something else to achieve that.
Any idea on what would be the proper way to do this?
Upvotes: 3
Views: 2489
Reputation: 33759
The solution is at your hands. I suggest that you do the following:
AWS::SSM::Parameter::Value<String>
or dynamic reference, e.g. {{resolve:ssm:S3AccessControl:2}}
)You can use either StackSets
for your regional stack deployments or create a parameterized build script that deploys the regional stacks one at the time (to be executed either locally or preferably by your CI/CD server).
Upvotes: 6