How to CDK Deploy All Stacks


Borislav Hadzhiev

Sat Apr 17 20211 min read


Photo by Yann Bervas

Deploying all Stacks in AWS CDK #

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

npx 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:

npx 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 #

Join my newsletter

I'll send you 1 email a week with links to all of the articles I've written that week

Buy Me A Coffee