Open yanhuiyi opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
Does the replica source have storage encrypted ? The times I've setup DB replication many of the properties came from the source database. It created fine, but the next time terraform was run it tries to 'correct' the config drift. In my cases 'correcting the config drift' was 'update the terraform config' rather than 'applying the .tf file'
In your case storage_encrypted = true
looks to be what is causing the replacement. You can add a lifecycle rule to ignore that once the DB replica is created
Thank you @timothyclarke! Putting the property to ignore_changes working fine so far.
lifecycle { ignore_changes = [storage_encrypted] }
I just experienced something similar but it seems to have been originated by an AWS api error caused by overlapping backup and maintenance windows settings.
In my case customer_owned_ip_enabled
, tags
and enabled_cloudwatch_logs_exports
were triggering a resource replacement.
Why AWS doesn't validate this before proceeding with a very time consuming and expensive operation is beyond me.
Edit: Validating for overlap on those windows in the provider would be nice!
Terraform Core Version
AWS Provider Version
~> 4.16
Affected Resource(s)
aws_db_instance
Expected Behavior
RDS replica instance shouldn't recreate every time.
Actual Behavior
terraform apply command output summary,
Relevant Error/Panic Output Snippet
Part of output while executing,
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None