Skip to content
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

InvalidDBInstanceState error when updating logging config and enabling performance insights simultaneously #21541

Closed
gblues opened this issue Oct 28, 2021 · 2 comments · Fixed by #23560
Assignees
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

Comments

@gblues
Copy link

gblues commented Oct 28, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

terraform version: 1.0.10
provider version: 3.63.0

Affected Resource(s)

  • aws_rds_cluster
  • aws_rds_cluster_instance

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:

  • the aws_rds_cluster resource is updated to update enabled_cloudwatch_logs_exports
  • the aws_rds_cluster_instance resource is updated as follows:
    • performance_insights_enabled is set to true
    • performance_insights_kms_key_id is set to the cluster's encryption key

I don't have the code factored out into a standalone reproduction case, but here are some other pertinent details:

  • both the cluster and instance are set with apply_immediately=true
  • the instance has an explicit depends_on dependency for the cluster

Expected Behavior

The cluster should update its logging settings, and the instance should enable performance insights

Actual Behavior

╷
│ Error: error modifying RDS Cluster Instance (<instance id>): InvalidDBInstanceState: Database instance is not in available state.
│       status code: 400, request id: <request_id>

Steps to Reproduce

  1. call the module with enable_performance_insights=false
  2. run terraform apply
  3. update the code to change enable_performance_insights=true
  4. run 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.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/rds Issues and PRs that pertain to the rds service. labels Oct 28, 2021
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. eventual-consistency Pertains to eventual consistency issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 28, 2021
@github-actions github-actions bot added this to the v4.6.0 milestone Mar 14, 2022
@YakDriver YakDriver self-assigned this Mar 15, 2022
@github-actions
Copy link

This functionality has been released in v4.6.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!

@github-actions
Copy link

github-actions bot commented May 7, 2022

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants