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

Terraform didn't wait for RDS to finish modifying #1761

Closed
hashibot opened this issue Sep 27, 2017 · 3 comments
Closed

Terraform didn't wait for RDS to finish modifying #1761

hashibot opened this issue Sep 27, 2017 · 3 comments
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@hashibot
Copy link

This issue was originally opened by @davidvuong as hashicorp/terraform#16170. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.10.5

Debug Output

First terraform apply

...
module.tf_rds.aws_db_instance.xxxx: Modifying... (ID: xxx)
  allocated_storage: "30" => "60"
module.tf_rds.aws_db_instance.xxx: Still modifying... (ID: xxx, 10s elapsed)
module.tf_rds.aws_db_instance.xxx: Still modifying... (ID: xxx, 20s elapsed)
module.tf_rds.aws_db_instance.xxx: Still modifying... (ID: xxx, 30s elapsed)
module.tf_rds.aws_db_instance.xxx: Modifications complete after 31s (ID: xxx)

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Subsequent terraform apply

Error applying plan:
1 error(s) occurred:
* module.tf_rds.aws_db_instance.xxx: 1 error(s) occurred:
* aws_db_instance.xxx: Error modifying DB Instance xxx: InvalidDBInstanceState: Database instance is not in available state.
	status code: 400, request id: xxx

Expected Behavior

terraform apply should wait for RDS to finish modifying.

Actual Behavior

  1. First apply completes within 31 seconds of modifying then mentions it successfully completes
  2. The plan immediately after the apply causes a -/+ on the already modified RDS
  3. Subsequent apply tries to make changes
  4. AWS complains and mentions it is not in an available state.

To me, on the surface it seems like there are multiple issues:

  1. Terraform shouldn't say the modifications are complete when they aren't
  2. Terraform should wait for the modifications to complete (perhaps poll AWS?)
  3. The state possibly wasn't updated after the 1st "successful" modification (or it was but was updated again during the state refresh?) when I went to plan immediately after.
@hashibot hashibot added the bug Addresses a defect in current functionality. label Sep 27, 2017
@radeksimko radeksimko added the service/rds Issues and PRs that pertain to the rds service. label Jan 28, 2018
@dvishniakov
Copy link

This is still happening on TF 0.11. Haven't tried it on 0.12. In our case the same issue happens after modifying DB cluster (i.e. changing SG groups), which leads to modification of DB instances. So when cluster modification is complete, different changes to cluster_db_instance (i.e instance type) fail, because DB instances are still being modified due to SG change.

@bflad bflad added this to the v1.34.0 milestone Jul 7, 2020
@bflad
Copy link
Contributor

bflad commented Jul 7, 2020

Hi folks 👋 The original issue here regarding the aws_db_instance resource not waiting for success on updates should have been resolved in version 1.34.0 of the Terraform AWS Provider. If you are still having lingering issues on more recent versions of the Terraform AWS Provider (2.69.0 is the current latest), please file a new bug report issue following the template and we can take a fresh look. Thanks.

@bflad bflad closed this as completed Jul 7, 2020
@ghost
Copy link

ghost commented Aug 6, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 6, 2020
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. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

No branches or pull requests

4 participants