-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(rds): RDS Parameter Group doesn't support custom removal policy #28660
Conversation
8ff160a
to
bd6254a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall code looks good to me, just a couple questions about the integ test and policy description.
publiclyAccessible: true, | ||
iamAuthentication: true, | ||
parameterGroup, | ||
removalPolicy: cdk.RemovalPolicy.DESTROY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original issue was not working when removalPolicy: RemovalPolicy.RETAIN
was set. I know for an integ test we can't leave behind the database but I just want to confirm that either:
- The issue wasn't specific to the
RETAIN
removal policy but rather any removal policy set for the databaseInstance or - If the issue was specific to the
RETAIN
removal policy that you were able to verify locally that the stack was sucessfully destroyed when the removal policy wasRETAIN
.
If the second case is true maybe we could update this integ test to use RemovalPolicy.RETAIN
and verify that the stack was destroyed before cleaning up the databaseInstance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this issue is not specific to RETAIN
rather setting any removal policy. I confirmed <2> by deploying a test stack with setting DBInstance and ParameterGroup to RETAIN
and deleting the stack. I can confirm that I'm no longer encountering the issue described in the issue #22141.
We can't update the integ test to use RETAIN
as we won't be able to cleanup the retained resources once the stack is deleted, which will cause leftover resources.
* The CloudFormation policy to apply when the instance is removed from the | ||
* stack or replaced during an update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this policy always needed or can we update the description to be more specific that it's only needed when the stack also has a DatabaseInstance
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't have to be used with DBInstance. It's technically a standalone removal policy that applies to ParameterGroup.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
The following is the current behaviour:
When destroying the stack
As pointed out in the issue linked below, we cannot simply use the clusterRds' or instanceRds' removal policy because the parameter group can be simultaneously binded to a cluster and an instance.
New behaviour:
Add an optional property
removalPolicy
to the L2 Parameter Group resource and set the deletion policy to the generated L1 Parameter Group (Either cluster or instance) depending on the usage.Added unit test and integration test to verify that it works as expected.
Closes #22141
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license