-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Bug]: aws_rds_cluster & aws_db_instance: backup_retention_period cannot be set to a blank value #33465
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I checked the provider code to find out how we could set a blank value, but the provider enforces that the value is an int.
|
Quick update for everyone: I have an open support case with Hashicorp fort this, they are investigating this internally. I'll report back with any significant updates if necessary. |
@morremeyer I'm guessing they can't do a lot unless the AWS API is changed. |
@grimm26 I misspoke when I said the SDK does not support not setting it because I misread the code. It does support that, it's just the Terraform provider/the specific resources that don't. |
This functionality has been released in v5.24.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Core Version
1.5.7
AWS Provider Version
5.16.2
Affected Resource(s)
Expected Behavior
The
backup_retention_period
can not be set to a blank value since defaults to0
foraws_db_instance
1
foraws_rds_cluster
However, a blank value is needed when using AWS Backup and not wanting to duplicate configuration. When AWS Backup is used, it manages the backup configuration for the cluster/instance and it is enforced that the values, if set, match up or are blank.
To have a single source of truth and not copy settings around, a blank value has to be set here.
The potential workaround of matching the values exactly also does not work without breaking the configuration temporarily, since changing the AWS Backup configuration that is responsible for the specific instance/cluster does not instantly apply this change back to the instance/cluster's backup configuration, but only when the AWS Backup plan runs the next time, leading to the
terraform apply
to fail until that has happened.An example of that is using AWS Backup with a plan that has a resource assignment based on tags. There are two plans,
continuous
, which does continuous backups with 35 days retention andcontinuous-short
, which does continuous backups with 4 days retention. Both are triggered at 07:00 UTC each day.When an RDS cluster being tagged for the
continuous
plan is switched to thecontinous-short
plan, we would update both the tag for the selection and thebackup_retention_period
at the same time with a conditional:This plan will apply the tag change, but will fail for the
backup_retention_period
until the next triggered run of thecontinuous-short
AWS Backup plan at 07:00 UTC since only that updates the RDS cluster configuration.Actual Behavior
backup_retention_period
can be set to a blank value for bothaws_rds_cluster
andaws_db_instance
resources.Relevant Error/Panic Output Snippet
Terraform Configuration Files
Can also be found in https://github.com/morremeyer/tf-aws-backup-retention
Steps to Reproduce
Using the configuration file pasted above, authenticate against AWS, then run:
try to configure
backup_retention_period
in a way that results in a blank value - you'll find it's not possible.Debug Output
Panic Output
No response
Important Factoids
No additional info
References
Would you like to implement a fix?
No
The text was updated successfully, but these errors were encountered: