Skip to content

fix(cli): route cdk destroy through toolkit-lib#1686

Merged
aws-cdk-automation merged 2 commits into
mainfrom
mrgrain/refactor/cli/destroy-via-toolkit-lib
Jun 30, 2026
Merged

fix(cli): route cdk destroy through toolkit-lib#1686
aws-cdk-automation merged 2 commits into
mainfrom
mrgrain/refactor/cli/destroy-via-toolkit-lib

Conversation

@mrgrain

@mrgrain mrgrain commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Routes cdk destroy through the toolkit-lib destroy action, the same way cdk list was rerouted, and removes the legacy CdkToolkit.destroy implementation.

User-facing output and behavior are unchanged. The CLI keeps the destroy output identical with CliIoHost listeners:

  • suppresses the toolkit-lib synthesis/destroy lifecycle lines the CLI never showed (it keeps emitting its own synth lines)
  • keeps the success line at info (toolkit-lib emits it as result)
  • --force auto-confirms the deletion prompt without showing it
  • a declined confirmation still exits non-zero with a soft "Deletion cancelled"

toolkit-lib behavior is unchanged: its destroy action still logs the declined confirmation and returns, and the CLI turns that into the non-zero exit (by throwing from the E7010 listener). The action label is preserved so a destroy triggered by a deploy still says "deployed", via a private _destroyWithAction.

The destroy IO-snapshot tests assert the recorded user-facing stream is unchanged.

Technical details

  • IO-snapshot recorder now omits listener-suppressed (dropped) messages by default, and requestResponse marks a suppressed prompt as dropped, so snapshots contain exactly what the user sees.

Fixes #

Checklist

  • This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed
    • Release notes for the new version:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@mrgrain mrgrain changed the title refactor(cli): route cdk destroy through toolkit-lib fix(cli): route cdk destroy through toolkit-lib Jun 29, 2026
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants