aws / aws/aws-cdk

Offer dry run option for cdk destroy

Open
#30,972 1 comment 11 reactions 0 assignees View on GitHub
@aws-cdk/pipelines effort/medium feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

It would be nice to see what the effect of using `cdk destroy` is without actually destroying anything. The ability to see a list of resources which would be destroyed during `cdk destory` perhaps at the same time validating the destroy would work would be useful.

### Use Case

We are establishing a destroy CI pipeline. As a significantly destructive operation, offering the ability to check what it will do prior to carrying out the destroy action would be very helpful.

### Proposed Solution

A dry run would show a list of resources to be destroyed, grouped by resource type and count, but not actually carry out a destroy action on anything. Flag via CLI, `cdk destroy --dry-run`

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.147.3

### Environment details (OS name and version, etc.)

Windows 10/latest Ubuntu GitHub actions runner

Contributor guide

Open the contributing guide

Research direction

Start at the CDK CLI entry point for `cdk destroy` and trace how destroy validation and resource selection currently work. Define the dry-run behavior from the issue: report resources grouped by type and count, validate that destruction would work, and make no destructive changes; verify the result through the CLI's existing destroy checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli, cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.