Terraform gives error while trying to upgrade PostgreSQL primary and read-replica in same module #20514
Labels
service/rds
Issues and PRs that pertain to the rds service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
upstream-terraform
Addresses functionality related to the Terraform core binary.
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Panic Output
Expected Behavior
Terraform should have upgraded PostgreSQL primary and read-replica from version 9.6.20 to version 12.5. To workaround, I upgraded the primary manually which upgraded both primary and read-replia RDS instanes.
Actual Behavior
Terraform gave below error:
As per AWS document, primary and read-replica instanes are upgraded simultaneously but I am not sure if there is a way to execute two resources in parallel in terraform.
I have put lifecycle in DB parameter group as per suggestion in this comment - #6448 (comment)
Steps to Reproduce
terraform apply
Important Factoids
I think this is a typical "Chicken-and-egg" problem in which terraform cannot decide which resource to apply first since AWS in the background is upgrading both RDS instances parallelly. I tried depends_on in read-replica but it gave same error.
References
I am creating this issue after suggestion from James Bardin in this issue - hashicorp/terraform#29334
The text was updated successfully, but these errors were encountered: