Skip to content

Conversation

james00012
Copy link
Contributor

Summary

RDS instances that are part of Aurora clusters have their deletion protection managed at the cluster level. Attempting to modify deletion protection on individual cluster member instances causes API errors.

This PR addresses two issues:

  1. Fixes deletion protection handling for cluster members: Checks if an RDS instance is part of a cluster before attempting to disable deletion protection. Only standalone instances have their deletion protection modified.

  2. Fixes filtering logic: The previous logic had an inverted condition that caused instances to be excluded when they should be included.

Changes

  • Added check to determine if instance is part of a cluster using DBClusterIdentifier
  • Only disable deletion protection for standalone instances (where DBClusterIdentifier is nil)
  • Added debug logging when skipping cluster member instances
  • Fixed the filtering logic to properly include instances matching the criteria

Testing

Tested with both standalone RDS instances and Aurora cluster members to ensure:

  • Standalone instances have deletion protection disabled before deletion
  • Cluster member instances skip deletion protection modification
  • Both types are deleted successfully when eligible

@james00012 james00012 requested a review from denis256 as a code owner October 7, 2025 01:05
…mbers

- Skip deletion protection changes for RDS cluster members to avoid AWS API errors
- Add comprehensive tests for cluster member deletion protection handling
- Fix linting issues
@james00012 james00012 force-pushed the fix/-rds-cluster-delete-protection branch from 6879620 to 0051fb5 Compare October 8, 2025 03:40
denis256
denis256 previously approved these changes Oct 8, 2025
@denis256
Copy link
Member

denis256 commented Oct 8, 2025

Changes look ok, but it is failing on lint

aws/resources/rds_test.go:159: File is not `gofmt`-ed with `-s` (gofmt)
                                ModifyCallExpected:     true, // Should call ModifyDBInstance

Fix comment alignment in test file to comply with gofmt -s rules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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