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.

CLI: cdk destroy behavior

See original GitHub issue

❓ General Issue

The Question

Suppose I am using Cloud9 in us-west-2 and I deploy to us-east-1 by setting the environment variable in the Stack Constructor. Later I remove the explicit environment identifier and then run cdk destroy, CDK will look in us-west-2 for the stack and claim the deletion was successful even though it didn’t delete anything. Should CDK throw an error or prompt the user if cdk destroy [STACK_NAME] doesn’t find a stack with the right name.

Environment

  • CDK CLI Version: 1.29.0
  • Module Version: N/A
  • OS: Amazon Linux
  • Language: Python

Other information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KTamascommented, Aug 26, 2021

I would very much support an option for this, just ran into this in our CI pipelines. CDK reports a certain stack was destroyed except said stack never existed the first place. It feels misleading however I look at it.

0reactions
KTamascommented, Aug 31, 2022

still an issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS CDK Toolkit (cdk command) - AWS Documentation
The AWS CDK Toolkit, the CLI command cdk , is the primary tool for interacting with your AWS CDK app. It executes your...
Read more >
How to Delete a CDK Stack in AWS CDK | bobbyhadz
We set the bucket's removalPolicy property to DESTROY , which means that if the bucket is empty when we delete the CDK stack,...
Read more >
Clean up | AWS CDK Workshop
If you would like to delete this stack, it will have to be done through the CloudFormation console. Head over to the CloudFormation...
Read more >
cdk deploy / destroy seem to ignore profile - AWS re:Post
There does appear to be a difference in behavior between the AWS CLI and CDK when it comes to handling of the config...
Read more >
AWS CDK Toolkit - npm
cdk deploy, Deploy a stack into an AWS account ; cdk watch, Watches a CDK app for deployable and hotswappable changes ; cdk...
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