cdk cli always exits with code 1 when doing a diff
See original GitHub issueCDK cli always exits with code 1 even if the result is the expected (getting a list of possible changes). This behaviour makes it hard to integrate with CI tools like GitLabCi. Exit code 1 should be expected if eg. AWS permission error for the command execution occured but not if there are outstanding changes.
Reproduction Steps
do a cdk diff
in any project using aws-cdk
What did you expect to happen?
Get a list of possible changes and exit code 0 if no error during the command occured
What actually happened?
cdk diff
always exits with code 1, which makes it hard to use in tools like gitlabci pipelines
Environment
- CLI Version : 1.60.0 (build 8e3f53a)
- Node.js Version: v14.7.0
- OS : MacOS Catalina 10.15.6
- Language (Version): all
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
What are the returned status code of `cdk diff`
The documentation for CDK diff states the following: --fail Fail with exit code 1 in case of diff [boolean] [default: false].
Read more >AWS CDK Toolkit (cdk command)
The AWS CDK Toolkit, the CLI command cdk , is the primary tool for interacting with your AWS CDK app. It executes your...
Read more >AWS CDK Toolkit
Computes differences between the infrastructure specified in the current state of the CDK app and the currently deployed application (or a user- ...
Read more >awslabs/aws-cdk - Gitter
One problem that I've found out is that commands like cdk diff exits with exit code 1 even though there are no issues....
Read more >Command: plan | Terraform
In teams that use a version control and code review workflow for making changes to real infrastructure, developers can use speculative plans to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shivlaks @jonny-rimek i set the property inside the context, passed it via CLI and added it to the cdk.json however still exits with 1. I tried it on other projects eg. the official examples and indeed it behaved as expected and exits with code 0.
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.