question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cdk cli always exits with code 1 when doing a diff

See original GitHub issue

CDK 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
PacoVKcommented, Sep 16, 2020

@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.

0reactions
github-actions[bot]commented, Jun 17, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found