Follow these steps to launch a stack in multiple regions:
- Log in to the AWS console and select the N. Virginia (us-east-1) region.
- Take note of your account ID in the account dropdown in the menu bar.
- If you haven't completed the previous recipe, do so now, and retain the YAML file on your filesystem. We will use that same template in the following step.
- Go to the CloudFormation console, and click StackSets, then Create StackSet.
- Upload the template file from the previous recipe.
- Give the stack a descriptive name, and choose an operating system:
StackSet details
- Click Next, and then select the role that is to be used for the administration of the StackSet:
StackSet options
- Click Next. On the following screen, you will configure the deployment options for the StackSet.
- Select Deploy stacks in accounts, and paste in your account number.
- Under Specify regions, select US East (N. Virginia) and US West (N. California):
StackSet deployment options
- Click Next, then Submit. Wait for the StackSet creation to complete.
- Go to the Stack instances tab in order to see the instances that were created:
Stack instances
- Go to the EC2 console in each region in order to confirm that the EC2 instances were created.
- In order to clean up the resources that were created in this recipe, go back to the CloudFormation console, and select the StackSet.
- Select Delete stacks from StackSet from the Actions drop-down menu.
- Enter the same configuration information as you did in steps 9-10, in order to specify the account and regions from which to delete stacks.
- Click Next, then Submit. Wait until the delete operation finishes.
- Now that the stacks are deleted, select Delete StackSet from the Actions drop-down menu.