-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No exception when stack with wrong cases is deployed #27179
No exception when stack with wrong cases is deployed #27179
Comments
If you know how to fix it then go for it. Inputting the name of a stack in your account + region doesn't work if it's not in your CDK app, so there would be no downsides i'm aware of for implementing this |
Sorry, i missed So I will drop my PR if you would submit PR. Until then, I'll keep my PR in draft for now. |
I didn't have time to work on it. Please go ahead with your PR and thanks for the consideration. |
This PR for cli is to warn if stacks with wrong cases (=not exist) specified in `cdk destroy`. Closes #27179. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
This PR for cli is to warn if stacks with wrong cases (=not exist) specified in `cdk destroy`. Closes aws#27179. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
### Issue # (if applicable) Closes #32545. Fixes #27179. ### Reason for this change Once this [PR](#27921) was reverted by other cli-integ test regression. - revert PR: #29577 - the test for regression: https://github.com/aws/aws-cdk/blob/07ce8ecc42782475d099b89944571375341c28d3/packages/%40aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts#L190 But the regression was apparently due to a cause unrelated to that PR. That has been corrected in [this PR](#31107) (see: https://github.com/aws/aws-cdk/blob/v2.173.1/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts#L286-L291). Therefore, I submit the same PR again. ### Description of changes This PR for cli is to warn if stacks with wrong cases (=not exist) specified in `cdk destroy`. \* It does not display the message `Are you sure you want to delete:` if there is no matching stack. \* Even if the stack does not exist, `cdk destroy` will not fail, it will just print a warning. Actual Outputs: ![cdk-destroy-warn](https://github.com/user-attachments/assets/c0d70037-c863-4c78-bc22-8b51264393ac) ### Describe any new or updated permissions being added <!— What new or updated IAM permissions are needed to support the changes being introduced ? --> Nothing. ### Description of how you validated changes Both of unit tests and cli-integ tests. The changes were already approved in the last PR. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
When invalid stack name is given to cdk destroy, it does not give an error, but does nothing.
Expected Behavior
Should give an error: "Stack does not exist"
Current Behavior
Nothing happens
Reproduction Steps
Stack "IAMStack" exists, but not "iamstack".
Also notice that it skips the stack name after the word "delete", as it is invalid.
Possible Solution
Just a check if the stack exists, if not throw error.
Additional Information/Context
No response
CDK CLI Version
2.89.0 (build 2ad6683)
Framework Version
No response
Node.js Version
20
OS
Mac M1 13.5.2 (22G91)
Language
Typescript
Language Version
No response
Other information
I'm willing to fix the issue if core team approves :)
The text was updated successfully, but these errors were encountered: