-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
MIG wait_for_instances completing immediately #3378
Comments
The below plan is near identical (Except he template for module a doesn't have any metadata changes since it is the 'start' of a chain of dependent modules):
However if you look at the actual application by Terraform, only module b correctly waits for the instance to come back (I've set a high min ready seconds to drag out the verification time). Both modules a & c return almost immediately:
It's almost as if there's a window where the operation is in a pending state and is not seen by Terraform as there being any ongoing operations, and it's chance whether you hit this window or not |
Hi - it seems to me that this was fixed in #4556 - if you update to any version past 2.18.0, you'll have the fix. |
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. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Terraform Version
v0.11.13
terraform-provider-null_v1.0.0_x4
terraform-provider-template_v1.0.0_x4
terraform-provider-random_v1.3.1_x4
terraform-provider-mongodbatlas_v0.8.1_x4
terraform-provider-cloudflare_v1.12.0_x4
terraform-provider-google_v2.3.0_x4
terraform-provider-google-beta_v2.3.0_x4
terraform-provider-aws_v2.4.0_x4
Affected Resource(s)
Terraform Configuration Files
Evaluated resource:
Debug Output
Panic Output
Expected Behavior
When making a change to the instance template used by the above instance group, this triggers a rollout of the undelying instances in line with the update policy specified:
With
wait_for_instances
set totrue
I'd expect Terraform to wait for the instance group to have all instances updated to use the latest template, and all be healthy before Terraform continues.Actual Behavior
Terraform completes almost immediately after updating the instance group, but does not wait for the operations against the instance group to be completed:
Terraform completed, however as per the screenshots below, the instance groups were still actually updating:
It appears here https://github.com/terraform-providers/terraform-provider-google/blob/6ff19d39cddb1af4f616d5b3830bf0714242313a/google/resource_compute_region_instance_group_manager.go#L357-L370 that it returns complete if
currentActions.none
is not less thantargetSize
. In our case our desired number of instances is only 1 (It's a manged instance group for a single machine with a static IP), however we want to ensure it has been fully created and is healthy before continuing:My desired behaviour would be to check that's there a no
pendingActions
before continuing (I'm a little unsure why it shows no current actions since the only instance in the group is to be deleted & recreated)Steps to Reproduce
wait_for_instances
totrue
in the MIGterraform apply
Edit
It's not wholely consistent; I've observed it actually waiting for instances too (With the exact same change, just modifying the startup script slightly):
The text was updated successfully, but these errors were encountered: