Skip to content

feat: configurable removalPolicy [INFRA-80168]#142

Open
ahammond wants to merge 2 commits intomainfrom
optional-retain
Open

feat: configurable removalPolicy [INFRA-80168]#142
ahammond wants to merge 2 commits intomainfrom
optional-retain

Conversation

@ahammond
Copy link
Copy Markdown
Contributor

@ahammond ahammond commented Mar 25, 2026

Note

High Risk
High risk because it changes the default CloudFormation DeletionPolicy for core Aurora infrastructure from Retain to Delete, which can lead to accidental database/secret/security-group deletion on stack removal if consumers don’t explicitly set RemovalPolicy.RETAIN.

Overview
Makes removalPolicy functional again and changes the default behavior. AuroraProps.removalPolicy is no longer deprecated/ignored; it now drives an ApplyRemovalPolicyAspect that applies the chosen policy to infrastructure resources (RDS cluster/instances, KMS key, Secrets Manager secrets/attachments, security groups, parameter/subnet groups), while ephemeral resources (Lambda/IAM/nested stacks/log groups/etc.) remain forced to RemovalPolicy.DESTROY.

Breaking change: the default for infrastructure resources flips from automatic RETAIN to DESTROY (CloudFormation DeletionPolicy Delete/unset). Tests are updated to assert the new default and that explicitly setting RemovalPolicy.RETAIN retains infrastructure resources, and CLAUDE.md is updated to document the transition.

Written by Cursor Bugbot for commit 6f573ac. Configure here.

@ahammond ahammond self-assigned this Mar 25, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.62%. Comparing base (1e8e664) to head (836943b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
- Coverage   96.63%   96.62%   -0.02%     
==========================================
  Files           6        6              
  Lines        1843     1837       -6     
  Branches      184      185       +1     
==========================================
- Hits         1781     1775       -6     
  Misses         62       62              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@ahammond ahammond enabled auto-merge (squash) March 25, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants