Deploy 2 dependent cloudformation stack parts in 2 regions

Viewed 109

I want to deploy 2 cloudformation stack parts in 2 different regions(us-east-1, eu-west-1).

One part creates vpc and x resources - I want deploy to us-east-1.

Second part creates y resources with dependencies to x.Outputs - I want deploy to eu-west-1.

I can't simply run the stack in eu-west-1 region( it will create only the first part)

Any way to do that?

1 Answers

When you deploy your stacks programmatically, using CLI for example and bash, you can do the following (cli example):

  1. use [deploy] command to deploy your stack in the first region. CLI has --region parameter to specify the region for the operation.

  2. using basic loop you can wait for the stack to be created. describe-stacks provides status of the stack creation.

  3. once the status is CREATE_COMPLETE you call describe-stacks one more time to get it outputs.

  4. you take the outputs from the stack, and deploy the second stack in the region you want. deploy command has --parameter-overrides which you can specify the input parameters for the second stack. These inputs will be from the outputs you got from the first stack.

You can do similar things using SDK, e.g. boto3 in python.

Related