aws-cdk: Running "cdk diff" returns error code 1
Despite the fix introduced in #4650. I’m still experiencing cdk diff exiting with status code 1.
Reproduction Steps
Run the following shell script:
#!/usr/bin/env bash
set -uo pipefail
cdk diff
EXIT_STATUS=$?
echo "Exit: $EXIT_STATUS"
Environment
- CLI Version : 1.21.1 (build 842cc5f)
- Framework Version: 1.21.1 (build 842cc5f)
- OS : macOS Catalina 10.15.2
- Language : Typescript
Other
Relates to #2111
This is 🐛 Bug Report
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (11 by maintainers)
thanks for the update! added this to the cdk.json files and it works as expected through codebuild.
@xycodex @udondan - yep that’s a bug (fix is being tracked in #7399)
Same issue as @udondan cdk version: 1.32.2 (build e19e206)
Resolved this issue by adding
"aws-cdk:enableDiffNoFail": "true"incdk.context.json. But, according to the changelog , cdk diff should always exit with 0 ?@nicklaw5 - can you provide some additional information?
what version of the CDK was your project created with? I’m trying to reproduce your error but can’t seem to get there.
Steps I’ve tried:
cdk init --language typescriptcdk diff- this has a diff (Conditions) ->echo $?returns 0cdk deploycdk diff- No differences ->echo $?returns0cdk diff --fail->echo $?returns1what does your
cdk.context.jsoncontain in it? does it have the"aws-cdk:enableDiffNoFail": "true"key?