How to CDK Deploy All Stacks

avatar

Borislav Hadzhiev

Sat Apr 17 20211 min read

banner

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.

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

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

Add me on LinkedIn

I'm a Web Developer with TypeScript, React.js, Node.js and AWS experience.

Let's connect on LinkedIn

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