I found the following package.json scripts very convenient when managing a complex CDK app. The key is the --
operator, which allows us to append additional parameters.
1 | { |
This configuration allows us to create convenient scripts like deploy/diff/synth, but we still have the ability to pass in additional parameters like:
npm run deploy -- --no-rollback --profile default
I can also define multiple entry points
cdk
: Interact with the stack directly.cdk:pipeline
: Deploy a CDK Pipeline which is able patch the CDK app when new changes are pushed.
A pipeline execution can be slow, so being able to circumvent the pipeline in a dev/sandbox environment is extremely useful.