Skip to content

Toolkit: stack update failure should show StackStatusReason #604

@mipearson

Description

@mipearson

Deleting the stack vpc-demo which exports a vpc reference currently used by other stacks fails with no message other than UPDATE_COMPLETE:

 ⏳  Starting destruction of stack vpc-demo...
 ❌  Destruction failed: vpc-demo Error: Failed to destroy vpc-demo (current state: UPDATE_COMPLETE)!
    at Object.destroyStack (/Users/mp/.nvm/versions/node/v10.7.0/lib/node_modules/aws-cdk/lib/api/deploy-stack.ts:152:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Failed to destroy vpc-demo (current state: UPDATE_COMPLETE)!

I would expect at best it to tell me which stacks are using its outputs or at worst the fact that it can't be deleted because of that.

Looking at the output of list-stacks via the AWS CLI shows that this error is present and should be returned to the user:

            "StackStatus": "UPDATE_COMPLETE",
            "StackStatusReason": "Export vpc-demo:DemoVPCPublicSubnetIDs0C2D9BEE cannot be deleted as it is in use by cdk-vpc-to-cfn-elb-demo and elb-cfn-demo"
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueRelated to contributions. See CONTRIBUTING.md

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions