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.
Description
The default retention should not be set if the user is sending null. For example, if the backup policy is managed via the AWS Backup Organization policy all the retentions will be managed via the backup policy and setting the retention policy at the instance/cluster level would cause an error mentioned below:
╷
│ Error: updating RDS Cluster (mydb-aurora-postgresql): InvalidParameterValue: RDS cluster mydb-aurora-postgresql is associated with the following AwsBackupRecoveryPointArn: arn:aws:backup:eu-central-1:123412341234:recovery-point:continuous:cluster-xxxxxxx. The BackupRetentionPeriod can be blank, or you can use the current value,15. For more details, see the AWS Backup documentation.
│ status code: 400, request id: 0050d544-de9e-4afd-abda-4e4287ef9a4b │
│ with module.mydb[0].module.aurora_database[0].module.rds_aurora.aws_rds_cluster.this[0],
│ on .terraform/modules/mydb.aurora_database.rds_aurora/main.tf line 59, in resource "aws_rds_cluster" "this":
│ 59: resource "aws_rds_cluster" "this" {
│
Motivation and Context
This change would allow the users to omit any value for the retention period to allow AWS Backup attached policy to manage the cluster backup retention period.
Breaking Changes
This will be breaking change if the user was using the module without providing any backup retention period and was relying on the given default.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request