aws / aws/aws-cdk-cli

CLI: `cdk deploy` should destroy stacks that have been removed from the app

Open
#787 20 comments 27 reactions 0 assignees View on GitHub
effort/large feature-request p1
Dominant language
TypeScript
Stars
105
Forks
122
Avg merge
1d 17h
Merged PRs (30d)
71

Description

## :question: General Issue

### The Question

cdk deploy leaves stack deployed if a stack is removed from application post deployment and cdk app is deployed again.

**Steps to Reproduce**
1. Create a CDK app with two stacks
1. Run: `cdk deploy --all`
1. Delete one stack from the CDK app
1. Run: `cdk deploy --all`

**Expected Results**
The deleted stack is gone.

**Actual Results**
The deleted stack exists and has been "leaked".

i.e. the stacks are procedural rather than declarative. This doesn't fit into a managed pipeline model as stacks will accidentally leak and have to be manually cleaned, while the behavior makes sense if you're familiar with the implementation details of CDK, this isn't the right developer experience.

### Environment

- **CDK CLI Version:** 1.73.0
- **Module Version:**
- **Node.js Version:** 12.x and 15.2.0
- **OS:** macOS Mojave and CodeBuild Ubuntu (not used other OSes)
- **Language (Version):** TypeScript (4.0.7)

### Other information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.