Skip to content
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

(aws_rds): Default value of deleteAutomatedBackups of DBInstance is mismatched from the Cfn and CDK Readme documentation #27973

Closed
khushail opened this issue Nov 13, 2023 · 1 comment · Fixed by #27977
Labels
documentation This is a problem with documentation. effort/small Small work item – less than a day of effort p2

Comments

@khushail
Copy link
Contributor

Describe the issue

Issue created for the SIM -14222059591

The customer has noticed that there is a discrepancy between the documentation for RDS DB Instances in CDK and CFN resulting in what appears to be unexpected behavior with this resource in regards to the deleteAutomatedBackups property for this resource. It appears that the documentation for this property in CDK is not correct.

In the CDK docs, this property is described as the following:

deleteAutomatedBackups?
Type: boolean (optional, default: false)
Indicates whether automated backups should be deleted or retained when you delete a DB instance.

And in the CFN docs for this property of the AWS::RDS::DBInstance resource, it says this:

DeleteAutomatedBackups
    A value that indicates whether to remove automated backups immediately after the DB instance is deleted. This parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB instance is deleted.

Therefore, as stated in the documentation for this property, the default behavior for this property when not defined is:

CDK: false, which means the backups would not be deleted
CFN: true, which means the backups would be deleted

In this case the customer had not defined this property in their CDK stack, and then when they deleted the stack saw that the backups were deleted, which was unexpected as per the CDK docs.

Links

Default value for deleteAutomatedBackups for DBInstance as per CFN docs - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbinstance.html#cfn-rds-dbinstance-deleteautomatedbackups

As mentioned in CDK Documentation - https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.DatabaseInstance.html#deleteautomatedbackups

As mentioned in CDK Code readme -https://github.com/aws/aws-cdk/blob/9d17fe2414b72595802ff94057af5a7efe711268/packages/aws-cdk-lib/aws-rds/lib/props.ts#L96C1-L96C1

@khushail khushail added needs-triage This issue or PR still needs to be triaged. documentation This is a problem with documentation. labels Nov 13, 2023
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Nov 13, 2023
@khushail khushail added p2 effort/small Small work item – less than a day of effort and removed @aws-cdk/aws-rds Related to Amazon Relational Database needs-triage This issue or PR still needs to be triaged. labels Nov 13, 2023
@khushail khushail changed the title (aws_rds): Default value of deleteAutomatedBackups of DBInstance is mismatched from the original doc (aws_rds): Default value of deleteAutomatedBackups of DBInstance is mismatched from the Cfn and CDK Readme documentation Nov 13, 2023
@mergify mergify bot closed this as completed in #27977 Nov 14, 2023
mergify bot pushed a commit that referenced this issue Nov 14, 2023
… to true (#27977)

Currently, the default value for deleteAutomatedBackups prop is described as `false` in CDK document.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.DatabaseInstance.html#deleteautomatedbackups

However, from underlying CloudFormation resource and RDS API perspective, `true` is correct default value.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbinstance.html#cfn-rds-dbinstance-deleteautomatedbackups
> A value that indicates whether to remove automated backups immediately after the DB instance is deleted. This parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB instance is deleted.

https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteDBInstance.html
> Specifies whether to remove automated backups immediately after the DB instance is deleted. This parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB instance is deleted.

Also, From CDK implementation perspective, deleteAutomatedBackups prop is simply passed to deleteAutomatedBackups parameter for CfnDBInstance (AWS::RDS::DBInstance).
https://github.com/aws/aws-cdk/blob/5665a959c6628e8786a14863f8d3177b4a1d9f7a/packages/aws-cdk-lib/aws-rds/lib/instance.ts#L856

This PR solves this discrepancy between the documentation for RDS DB Instances in CDK and CFn.

Closes #27973

----

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

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant