Skip to content

No exception when stack with wrong cases is destroyed #27179

@fulcus

Description

@fulcus

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

> cdk destroy iamstack
Are you sure you want to delete:  (y/n)? y

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.closed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.effort/smallSmall work item – less than a day of effortp2package/toolsRelated to AWS CDK Tools or CLIresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions