How to CDK Deploy All Stacks

avatar

Borislav Hadzhiev

Last updated: Apr 14, 2022

banner

Check out my new book

Deploying all Stacks in AWS CDK #

In order to deploy all stacks with the cdk deploy command, we have to use the * (asterisk) character.

shell
npx aws-cdk deploy "*"

The cdk deploy command takes wildcards, where * matches any number of characters and ? matches a single character.

For example to deploy all stacks that start with the name my-stack issue the following command:

shell
npx aws-cdk deploy "my-stack*"

The command above would deploy my-stack-dev, my-stack-prod, etc.

When using wildcards we have to always wrap the wild card characters in quotes, otherwise our shell may try to auto complete the wild card to names of files in the current directory.

Further Reading #

Use the search field on my Home Page to filter through my more than 3,000 articles.