InvalidDBInstanceState error when updating logging config and enabling performance insights simultaneously #21541
Labels
bug
Addresses a defect in current functionality.
eventual-consistency
Pertains to eventual consistency issues.
service/rds
Issues and PRs that pertain to the rds service.
Milestone
Community Note
Terraform CLI and Terraform AWS Provider Version
terraform version: 1.0.10
provider version: 3.63.0
Affected Resource(s)
Terraform Configuration Files
I have a module that creates Amazon Aurora MySQL clusters. One of the parameters is
enable_performance_insights
which has two effects:aws_rds_cluster
resource is updated to updateenabled_cloudwatch_logs_exports
aws_rds_cluster_instance
resource is updated as follows:performance_insights_enabled
is set to trueperformance_insights_kms_key_id
is set to the cluster's encryption keyI don't have the code factored out into a standalone reproduction case, but here are some other pertinent details:
apply_immediately=true
depends_on
dependency for the clusterExpected Behavior
The cluster should update its logging settings, and the instance should enable performance insights
Actual Behavior
Steps to Reproduce
enable_performance_insights=false
terraform apply
enable_performance_insights=true
terraform apply
Important Facts
I'm pretty sure what's happening is that terraform tries to apply the instance change immediately after the cluster change API request returns, and fails because the cluster update causes the cluster to go non-ready while the logging config changes, and so the cluster modification should be waiting for the cluster to become ready before proceeding.
If a complete reproduction case is absolutely critical, I can put one together but I don't have the time for it right at this moment, and I think the issue is obvious enough to not need it.
The text was updated successfully, but these errors were encountered: