fix(cloudformation-diff): classify retained removals as orphaned - #1890
Merged
aws-cdk-automation merged 1 commit intoAug 25, 2026
Merged
Conversation
mrgrain
approved these changes
Aug 25, 2026
Contributor
|
Nice one, thank you! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1890 +/- ##
==========================================
- Coverage 91.38% 91.34% -0.04%
==========================================
Files 80 80
Lines 12264 12264
Branches 1747 1745 -2
==========================================
- Hits 11207 11203 -4
- Misses 1021 1025 +4
Partials 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1882
ResourceDifference.changeImpactcurrently treats removed resources withDeletionPolicy: RetainExceptOnCreateasWILL_DESTROY. For a resource that already exists and is removed from a template, CloudFormation retains it under this policy, just as it does withRetain.This changes removal classification to return
WILL_ORPHANfor bothRetainandRetainExceptOnCreate. Existing no-policy/Deletebehavior remainsWILL_DESTROY;Snapshotbehavior is unchanged, leaving that separate API decision to maintainers.The existing deletion-impact test is parameterized to cover both retention policies while retaining no-policy coverage.
Validation:
git diff --checkrepo.yarnpkg.comwas unavailable (EAI_AGAIN).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license