(cli): Provide a way to ignore "This app contains no stacks" #29797
Labels
cli
Issues related to the CDK CLI
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
package/tools
Related to AWS CDK Tools or CLI
Describe the feature
It would be nice if I could ignore the "This app contains no stacks" error message specifically.
@msambol added
--ignore-no-stacks
to thecdk deploy
command with #28387, but this flag should be respected on all commands that fail if stacks are not present (e.g.,synth
,diff,
deploy
, etc.)Use Case
In many cases, I have a dev and prod AWS account. When I first develop a new CDK project, I often want to only deploy the dev account, while later deploying to dev and prod. I often write this code like this:
However, this fails with the error message "This app contains no stacks".
You might think, "why not just set up deployment to not happen until you're ready?". My common use case is a monorepo with many projects. My CI uses
lerna
to runcdk diff
automatically in projects that changed.Proposed Solution
A CLI flag like
--ignore-no-stacks
would be great. This reminds me ofjest
's--passWithNoTests
flag that's helpful when you've installed jest but not written tests yet.Other Information
I've hacked my way around this by creating this script:
and updating the
package.json
'scdk
script to call this instead.Acknowledgements
CDK version used
2.137.0
Environment details (OS name and version, etc.)
MacOS Sonoma
The text was updated successfully, but these errors were encountered: