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

MIG wait_for_instances completing immediately #3378

Closed
Evesy opened this issue Apr 4, 2019 · 3 comments
Closed

MIG wait_for_instances completing immediately #3378

Evesy opened this issue Apr 4, 2019 · 3 comments
Assignees
Labels

Comments

@Evesy
Copy link

Evesy commented Apr 4, 2019

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 "me too" comments, 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
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

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)

  • google_compute_instance_group_manager

Terraform Configuration Files

resource "google_compute_instance_group_manager" "default" {
  provider = "google-beta"
  project            = "${var.project}"
  name               = "${var.name}"
  description        = "compute VM Instance Group"
  wait_for_instances = "${var.wait_for_instances}"

  base_instance_name = "${var.name}"

  # instance_template = "${google_compute_instance_template.default.self_link}"

  version {
    name = "default"
    instance_template = "${google_compute_instance_template.default.self_link}"
  }

  zone = "${var.zone}"

  update_policy{
    type = "PROACTIVE"
    minimal_action = "REPLACE"
    max_surge_fixed = 0
    max_unavailable_fixed = 1
    min_ready_sec = 180
  }

  target_pools = ["${var.target_pools}"]

  target_size = "${var.size}"

  named_port {
    name = "${var.service_port_name}"
    port = "${var.service_port}"
  }

  auto_healing_policies = {
    health_check      = "${var.http_health_check ? element(concat(google_compute_health_check.mig-health-check.*.self_link, list("")), 0) : ""}"
    initial_delay_sec = "${var.hc_initial_delay}"
  }

  provisioner "local-exec" {
    when    = "destroy"
    command = "${var.local_cmd_destroy}"
  }

  provisioner "local-exec" {
    when    = "create"
    command = "${var.local_cmd_create}"
  }
}

Evaluated resource:

module.nat-gateway-zone-c.nat-gateway.google_compute_instance_group_manager.default:
  id = <redacted>/europe-west4-c/nat-gateway-europe-west4-c
  auto_healing_policies.# = 1
  auto_healing_policies.0.health_check = https://www.googleapis.com/compute/beta/projects/<redacted>/global/healthChecks/nat-gateway-europe-west4-c
  auto_healing_policies.0.initial_delay_sec = 30
  base_instance_name = nat-gateway-europe-west4-c
  description = compute VM Instance Group
  fingerprint = JdT1NUPP9nk=
  instance_group = https://www.googleapis.com/compute/v1/projects/<redacted>/zones/europe-west4-c/instanceGroups/nat-gateway-europe-west4-c
  name = nat-gateway-europe-west4-c
  named_port.# = 1
  named_port.1915903613.name = http
  named_port.1915903613.port = 80
  project = <redacted>
  self_link = https://www.googleapis.com/compute/v1/projects/<redacted>/zones/europe-west4-c/instanceGroupManagers/nat-gateway-europe-west4-c
  target_pools.# = 0
  target_size = 1
  update_policy.# = 1
  update_policy.0.max_surge_fixed = 0
  update_policy.0.max_surge_percent = 0
  update_policy.0.max_unavailable_fixed = 1
  update_policy.0.max_unavailable_percent = 0
  update_policy.0.min_ready_sec = 180
  update_policy.0.minimal_action = REPLACE
  update_policy.0.type = PROACTIVE
  version.# = 1
  version.0.instance_template = https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404122534965200000001
  version.0.name = default
  version.0.target_size.# = 0
  wait_for_instances = true
  zone = europe-west4-c

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:

  ~ module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_group_manager.default
      version.0.instance_template:                                                  "https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404122534965200000001" => "${google_compute_instance_template.default.self_link}"

With wait_for_instances set to true 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:

module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default: Creation complete after 5s (ID: default-20190404123847924200000002)
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_group_manager.default: Modifying... (ID: at-delivery-platform-testing/europe-west4-a/nat-gateway-europe-west4-a)
  version.0.instance_template: "https://www.googleapis.com/compute/v1/projects/at-delivery-platform-testing/global/instanceTemplates/default-20190404122535016600000003" => "https://www.googleapis.com/compute/beta/projects/at-delivery-platform-testing/global/instanceTemplates/default-20190404123847924200000002"
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_group_manager.default: Modifications complete after 4s (ID: at-delivery-platform-testing/europe-west4-a/nat-gateway-europe-west4-a)
module.nat-gateway-zone-a.module.nat-gateway.null_resource.dummy_dependency: Creation complete after 0s (ID: 3064161603459756757)
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default.deposed: Destroying... (ID: default-20190404122535016600000003)
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default.deposed: Destruction complete after 3s

Apply complete! Resources: 6 added, 4 changed, 6 destroyed.

Terraform completed, however as per the screenshots below, the instance groups were still actually updating:

Screenshot 2019-04-04 at 13 39 22

Screenshot 2019-04-04 at 13 29 29

Screenshot 2019-04-04 at 13 26 40

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 than targetSize. 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:

2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: ---[ REQUEST ]---------------------------------------
2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: GET /compute/beta/projects/<redacted>/zones/europe-west4-b/instanceGroupManagers/nat-gateway-europe-west4-b?alt=json&prettyPrint=false HTTP/1.1
2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Host: www.googleapis.com
2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: User-Agent: google-api-go-client/0.5 Terraform/0.11.9 (+https://www.terraform.io) terraform-provider-google-beta/2.3.0
2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Accept-Encoding: gzip
2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:
2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:
2019-04-04T13:08:42.199Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: -----------------------------------------------------
2019-04-04T13:08:42.515Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: 2019/04/04 13:08:42 [DEBUG] Google API Response Details:
2019-04-04T13:08:42.515Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: ---[ RESPONSE ]--------------------------------------
2019-04-04T13:08:42.515Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: HTTP/2.0 200 OK
2019-04-04T13:08:42.515Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Alt-Svc: quic=":443"; ma=2592000; v="46,44,43,39"
2019-04-04T13:08:42.517Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Cache-Control: private, max-age=0, must-revalidate, no-transform
2019-04-04T13:08:42.518Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Content-Type: application/json; charset=UTF-8
2019-04-04T13:08:42.518Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Date: Thu, 04 Apr 2019 13:08:42 GMT
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Etag: "wf4FiKZ76z0FYexcHbS8wIeWFjQ=/ZMbu5toy98BN2XfQBbo2Q6oP1xk="
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Expires: Thu, 04 Apr 2019 13:08:42 GMT
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Server: GSE
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Vary: Origin
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: Vary: X-Origin
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: X-Content-Type-Options: nosniff
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: X-Frame-Options: SAMEORIGIN
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: X-Xss-Protection: 1; mode=block
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4: {
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "kind": "compute#instanceGroupManager",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "id": "2774487435893259517",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "creationTimestamp": "2019-03-29T04:31:30.089-07:00",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "name": "nat-gateway-europe-west4-b",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "description": "compute VM Instance Group",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "zone": "https://www.googleapis.com/compute/beta/projects/<redacted>/zones/europe-west4-b",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "instanceTemplate": "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404130829278900000003",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "versions": [
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   {
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "name": "default",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "instanceTemplate": "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404130829278900000003",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "targetSize": {
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:     "calculated": 1
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    }
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   }
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  ],
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "instanceGroup": "https://www.googleapis.com/compute/beta/projects/<redacted>/zones/europe-west4-b/instanceGroups/nat-gateway-europe-west4-b",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "baseInstanceName": "nat-gateway-europe-west4-b",
2019-04-04T13:08:42.520Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "fingerprint": "so0dX8XfqQE=",
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "currentActions": {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "none": 1,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "creating": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "creatingWithoutRetries": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "verifying": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "recreating": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "deleting": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "abandoning": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "restarting": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "refreshing": 0
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  },
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "pendingActions": {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "creating": 1,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "deleting": 1,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "recreating": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "restarting": 0
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  },
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "status": {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "isStable": false,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "versionTarget": {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "isReached": false
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   }
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  },
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "targetSize": 1,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "selfLink": "https://www.googleapis.com/compute/beta/projects/<redacted>/zones/europe-west4-b/instanceGroupManagers/nat-gateway-europe-west4-b",
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "autoHealingPolicies": [
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "healthCheck": "https://www.googleapis.com/compute/beta/projects/<redacted>/global/healthChecks/nat-gateway-europe-west4-b",
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "initialDelaySec": 30
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   }
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  ],
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "updatePolicy": {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "type": "PROACTIVE",
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "minimalAction": "REPLACE",
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "maxSurge": {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "fixed": 0,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "calculated": 0
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   },
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "maxUnavailable": {
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "fixed": 1,
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "calculated": 1
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   },
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "minReadySec": 180
2019-04-04T13:08:42.521Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  },
module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_group_manager.default: Modifications complete after 10s (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b)

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

  1. Create a managed instance template & a managed instance group to use that template.
  2. Set wait_for_instances to true in the MIG
  3. Make a change to the template (e.g. startup script)
  4. terraform apply
  5. Observe state of MIG update after Terraform has completed

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):

2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "fingerprint": "rNZfjMSoiw0=",
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "currentActions": {
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "none": 0,
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "creating": 0,
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "creatingWithoutRetries": 0,
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "verifying": 1,
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "recreating": 0,
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "deleting": 0,
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "abandoning": 0,
2019-04-04T15:39:33.901Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "restarting": 0,
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "refreshing": 0
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  },
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "pendingActions": {
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "creating": 0,
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "deleting": 0,
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "recreating": 0,
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "restarting": 0
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  },
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "status": {
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "isStable": false,
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   "versionTarget": {
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:    "isReached": true
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:   }
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  },
2019-04-04T15:39:33.902Z [DEBUG] plugin.terraform-provider-google-beta_v2.3.0_x4:  "targetSize": 1,
@ghost ghost added the bug label Apr 4, 2019
@Evesy
Copy link
Author

Evesy commented Apr 4, 2019

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):

Terraform will perform the following actions:

  ~ module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_group_manager.default
      version.0.instance_template:                         "https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404165417483900000002" => "${google_compute_instance_template.default.self_link}"

-/+ module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default (new resource required)
      id:                                                  "default-20190404165417483900000002" => <computed> (forces new resource)
      can_ip_forward:                                      "true" => "true"
      disk.#:                                              "1" => "1"
      disk.0.auto_delete:                                  "true" => "true"
      disk.0.boot:                                         "true" => "true"
      disk.0.device_name:                                  "persistent-disk-0" => <computed>
      disk.0.disk_size_gb:                                 "0" => "0"
      disk.0.disk_type:                                    "pd-ssd" => "pd-ssd"
      disk.0.interface:                                    "SCSI" => <computed>
      disk.0.mode:                                         "READ_WRITE" => <computed>
      disk.0.source_image:                                 "projects/debian-cloud/global/images/family/debian-9" => "debian-cloud/debian-9"
      disk.0.type:                                         "PERSISTENT" => "PERSISTENT"
      labels.%:                                            "1" => "1"
      labels.app:                                          "nat-gateway" => "nat-gateway"
      machine_type:                                        "n1-standard-2" => "n1-standard-2"
      metadata.%:                                          "2" => "2"
      metadata.startup-script:                             <redacted> (forces new resource)
      metadata.tf_depends_id:                              "" => ""
      metadata_fingerprint:                                "zXYOKREkAo8=" => <computed>
      name:                                                "default-20190404165417483900000002" => <computed>
      name_prefix:                                         "default-" => "default-"
      network_interface.#:                                 "1" => "1"
      network_interface.0.access_config.#:                 "1" => "1"
      network_interface.0.access_config.0.assigned_nat_ip: "" => <computed>
      network_interface.0.access_config.0.nat_ip:          <redacted>
      network_interface.0.access_config.0.network_tier:    "PREMIUM" => <computed>
      network_interface.0.address:                         "" => <computed>
      network_interface.0.network_ip:                      "10.207.160.34" => "10.207.160.34"
      network_interface.0.subnetwork:                      "https://www.googleapis.com/compute/v1/projects/<redacted>/regions/europe-west4/subnetworks/delivery-platform-general" => "delivery-platform-general"
      network_interface.0.subnetwork_project:              "<redacted>" => <computed>
      project:                                             "<redacted>" => <computed>
      region:                                              "europe-west4" => "europe-west4"
      scheduling.#:                                        "1" => <computed>
      self_link:                                           "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404165417483900000002" => <computed>
      service_account.#:                                   "1" => "1"
      service_account.0.email:                             "default" => "default"
      service_account.0.scopes.#:                          "4" => "4"
      service_account.0.scopes.1693978638:                 "https://www.googleapis.com/auth/devstorage.full_control" => "https://www.googleapis.com/auth/devstorage.full_control"
      service_account.0.scopes.172152165:                  "https://www.googleapis.com/auth/logging.write" => "https://www.googleapis.com/auth/logging.write"
      service_account.0.scopes.299962681:                  "https://www.googleapis.com/auth/compute" => "https://www.googleapis.com/auth/compute"
      service_account.0.scopes.4177124133:                 "https://www.googleapis.com/auth/monitoring.write" => "https://www.googleapis.com/auth/monitoring.write"
      tags.#:                                              "3" => "3"
      tags.2508137496:                                     "inst-nat-europe-west4" => "inst-nat-europe-west4"
      tags.2542268873:                                     "allow-ssh" => "allow-ssh"
      tags.3848204329:                                     "inst-nat-europe-west4-a" => "inst-nat-europe-west4-a"
      tags_fingerprint:                                    "" => <computed>

-/+ module.nat-gateway-zone-a.module.nat-gateway.null_resource.dummy_dependency (new resource required)
      id:                                                  "7710320696792349225" => <computed> (forces new resource)
      triggers.%:                                          "1" => <computed> (forces new resource)
      triggers.instance_template:                          "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404165417483900000002" => "" (forces new resource)

  ~ module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_group_manager.default
      version.0.instance_template:                         "https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404165934489100000001" => "${google_compute_instance_template.default.self_link}"

-/+ module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_template.default (new resource required)
      id:                                                  "default-20190404165934489100000001" => <computed> (forces new resource)
      can_ip_forward:                                      "true" => "true"
      disk.#:                                              "1" => "1"
      disk.0.auto_delete:                                  "true" => "true"
      disk.0.boot:                                         "true" => "true"
      disk.0.device_name:                                  "persistent-disk-0" => <computed>
      disk.0.disk_size_gb:                                 "0" => "0"
      disk.0.disk_type:                                    "pd-ssd" => "pd-ssd"
      disk.0.interface:                                    "SCSI" => <computed>
      disk.0.mode:                                         "READ_WRITE" => <computed>
      disk.0.source_image:                                 "projects/debian-cloud/global/images/family/debian-9" => "debian-cloud/debian-9"
      disk.0.type:                                         "PERSISTENT" => "PERSISTENT"
      labels.%:                                            "1" => "1"
      labels.app:                                          "nat-gateway" => "nat-gateway"
      machine_type:                                        "n1-standard-2" => "n1-standard-2"
      metadata.%:                                          "2" => <computed> (forces new resource)
      metadata.startup-script:                             <redacted> (forces new resource)
      metadata.tf_depends_id:                              "7710320696792349225" => "" (forces new resource)
      metadata_fingerprint:                                "FUF25IBWKVI=" => <computed>
      name:                                                "default-20190404165934489100000001" => <computed>
      name_prefix:                                         "default-" => "default-"
      network_interface.#:                                 "1" => "1"
      network_interface.0.access_config.#:                 "1" => "1"
      network_interface.0.access_config.0.assigned_nat_ip: "" => <computed>
      network_interface.0.access_config.0.nat_ip:          <redacted>
      network_interface.0.access_config.0.network_tier:    "PREMIUM" => <computed>
      network_interface.0.address:                         "" => <computed>
      network_interface.0.network_ip:                      "10.207.160.36" => "10.207.160.36"
      network_interface.0.subnetwork:                      "https://www.googleapis.com/compute/v1/projects/<redacted>/regions/europe-west4/subnetworks/delivery-platform-general" => "delivery-platform-general"
      network_interface.0.subnetwork_project:              "<redacted>" => <computed>
      project:                                             "<redacted>" => <computed>
      region:                                              "europe-west4" => "europe-west4"
      scheduling.#:                                        "1" => <computed>
      self_link:                                           "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404165934489100000001" => <computed>
      service_account.#:                                   "1" => "1"
      service_account.0.email:                             "default" => "default"
      service_account.0.scopes.#:                          "4" => "4"
      service_account.0.scopes.1693978638:                 "https://www.googleapis.com/auth/devstorage.full_control" => "https://www.googleapis.com/auth/devstorage.full_control"
      service_account.0.scopes.172152165:                  "https://www.googleapis.com/auth/logging.write" => "https://www.googleapis.com/auth/logging.write"
      service_account.0.scopes.299962681:                  "https://www.googleapis.com/auth/compute" => "https://www.googleapis.com/auth/compute"
      service_account.0.scopes.4177124133:                 "https://www.googleapis.com/auth/monitoring.write" => "https://www.googleapis.com/auth/monitoring.write"
      tags.#:                                              "3" => "3"
      tags.2086117779:                                     "inst-nat-europe-west4-b" => "inst-nat-europe-west4-b"
      tags.2508137496:                                     "inst-nat-europe-west4" => "inst-nat-europe-west4"
      tags.2542268873:                                     "allow-ssh" => "allow-ssh"
      tags_fingerprint:                                    "" => <computed>

-/+ module.nat-gateway-zone-b.module.nat-gateway.null_resource.dummy_dependency (new resource required)
      id:                                                  "5243515173846081974" => <computed> (forces new resource)
      triggers.%:                                          "1" => <computed> (forces new resource)
      triggers.instance_template:                          "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404165934489100000001" => "" (forces new resource)

  ~ module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_group_manager.default
      version.0.instance_template:                         "https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404165948392600000002" => "${google_compute_instance_template.default.self_link}"

-/+ module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_template.default (new resource required)
      id:                                                  "default-20190404165948392600000002" => <computed> (forces new resource)
      can_ip_forward:                                      "true" => "true"
      disk.#:                                              "1" => "1"
      disk.0.auto_delete:                                  "true" => "true"
      disk.0.boot:                                         "true" => "true"
      disk.0.device_name:                                  "persistent-disk-0" => <computed>
      disk.0.disk_size_gb:                                 "0" => "0"
      disk.0.disk_type:                                    "pd-ssd" => "pd-ssd"
      disk.0.interface:                                    "SCSI" => <computed>
      disk.0.mode:                                         "READ_WRITE" => <computed>
      disk.0.source_image:                                 "projects/debian-cloud/global/images/family/debian-9" => "debian-cloud/debian-9"
      disk.0.type:                                         "PERSISTENT" => "PERSISTENT"
      labels.%:                                            "1" => "1"
      labels.app:                                          "nat-gateway" => "nat-gateway"
      machine_type:                                        "n1-standard-2" => "n1-standard-2"
      metadata.%:                                          "2" => <computed> (forces new resource)
      metadata.startup-script:                             <redacted> (forces new resource)
      metadata.tf_depends_id:                              "5243515173846081974" => "" (forces new resource)
      metadata_fingerprint:                                "KEVpWE6tBqU=" => <computed>
      name:                                                "default-20190404165948392600000002" => <computed>
      name_prefix:                                         "default-" => "default-"
      network_interface.#:                                 "1" => "1"
      network_interface.0.access_config.#:                 "1" => "1"
      network_interface.0.access_config.0.assigned_nat_ip: "" => <computed>
      network_interface.0.access_config.0.nat_ip:          <redacted>
      network_interface.0.access_config.0.network_tier:    "PREMIUM" => <computed>
      network_interface.0.address:                         "" => <computed>
      network_interface.0.network_ip:                      "10.207.160.35" => "10.207.160.35"
      network_interface.0.subnetwork:                      "https://www.googleapis.com/compute/v1/projects/<redacted>/regions/europe-west4/subnetworks/delivery-platform-general" => "delivery-platform-general"
      network_interface.0.subnetwork_project:              "<redacted>" => <computed>
      project:                                             "<redacted>" => <computed>
      region:                                              "europe-west4" => "europe-west4"
      scheduling.#:                                        "1" => <computed>
      self_link:                                           "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404165948392600000002" => <computed>
      service_account.#:                                   "1" => "1"
      service_account.0.email:                             "default" => "default"
      service_account.0.scopes.#:                          "4" => "4"
      service_account.0.scopes.1693978638:                 "https://www.googleapis.com/auth/devstorage.full_control" => "https://www.googleapis.com/auth/devstorage.full_control"
      service_account.0.scopes.172152165:                  "https://www.googleapis.com/auth/logging.write" => "https://www.googleapis.com/auth/logging.write"
      service_account.0.scopes.299962681:                  "https://www.googleapis.com/auth/compute" => "https://www.googleapis.com/auth/compute"
      service_account.0.scopes.4177124133:                 "https://www.googleapis.com/auth/monitoring.write" => "https://www.googleapis.com/auth/monitoring.write"
      tags.#:                                              "3" => "3"
      tags.189829381:                                      "inst-nat-europe-west4-c" => "inst-nat-europe-west4-c"
      tags.2508137496:                                     "inst-nat-europe-west4" => "inst-nat-europe-west4"
      tags.2542268873:                                     "allow-ssh" => "allow-ssh"
      tags_fingerprint:                                    "" => <computed>

-/+ module.nat-gateway-zone-c.module.nat-gateway.null_resource.dummy_dependency (new resource required)
      id:                                                  "3745211786332547597" => <computed> (forces new resource)
      triggers.%:                                          "1" => <computed> (forces new resource)
      triggers.instance_template:                          "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404165948392600000002" => "" (forces new resource)


Plan: 6 to add, 3 to change, 6 to destroy.

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:

module.nat-gateway-zone-c.module.nat-gateway.null_resource.dummy_dependency: Destroying... (ID: 3745211786332547597)
module.nat-gateway-zone-c.module.nat-gateway.null_resource.dummy_dependency: Destruction complete after 0s
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default: Creating...
  can_ip_forward:                                      "" => "true"
  disk.#:                                              "" => "1"
  disk.0.auto_delete:                                  "" => "true"
  disk.0.boot:                                         "" => "true"
  disk.0.device_name:                                  "" => "<computed>"
  disk.0.disk_size_gb:                                 "" => "0"
  disk.0.disk_type:                                    "" => "pd-ssd"
  disk.0.interface:                                    "" => "<computed>"
  disk.0.mode:                                         "" => "<computed>"
  disk.0.source_image:                                 "" => "debian-cloud/debian-9"
  disk.0.type:                                         "" => "PERSISTENT"
  labels.%:                                            "" => "1"
  labels.app:                                          "" => "nat-gateway"
  machine_type:                                        "" => "n1-standard-2"
  metadata.%:                                          "" => "2"
  metadata.startup-script:                             "" => <redacted>
  metadata.tf_depends_id:                              "" => ""
  metadata_fingerprint:                                "" => "<computed>"
  name:                                                "" => "<computed>"
  name_prefix:                                         "" => "default-"
  network_interface.#:                                 "" => "1"
  network_interface.0.access_config.#:                 "" => "1"
  network_interface.0.access_config.0.assigned_nat_ip: "" => "<computed>"
  network_interface.0.access_config.0.nat_ip:          "" => <redacted>
  network_interface.0.access_config.0.network_tier:    "" => "<computed>"
  network_interface.0.address:                         "" => "<computed>"
  network_interface.0.network_ip:                      "" => "10.207.160.34"
  network_interface.0.subnetwork:                      "" => "delivery-platform-general"
  network_interface.0.subnetwork_project:              "" => "<computed>"
  project:                                             "" => "<computed>"
  region:                                              "" => "europe-west4"
  scheduling.#:                                        "" => "<computed>"
  self_link:                                           "" => "<computed>"
  service_account.#:                                   "" => "1"
  service_account.0.email:                             "" => "default"
  service_account.0.scopes.#:                          "" => "4"
  service_account.0.scopes.1693978638:                 "" => "https://www.googleapis.com/auth/devstorage.full_control"
  service_account.0.scopes.172152165:                  "" => "https://www.googleapis.com/auth/logging.write"
  service_account.0.scopes.299962681:                  "" => "https://www.googleapis.com/auth/compute"
  service_account.0.scopes.4177124133:                 "" => "https://www.googleapis.com/auth/monitoring.write"
  tags.#:                                              "" => "3"
  tags.2508137496:                                     "" => "inst-nat-europe-west4"
  tags.2542268873:                                     "" => "allow-ssh"
  tags.3848204329:                                     "" => "inst-nat-europe-west4-a"
  tags_fingerprint:                                    "" => "<computed>"
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default: Creation complete after 5s (ID: default-20190404170522053400000001)
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_group_manager.default: Modifying... (ID: <redacted>/europe-west4-a/nat-gateway-europe-west4-a)
  version.0.instance_template: "https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404165417483900000002" => "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404170522053400000001"
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_group_manager.default: Modifications complete after 4s (ID: <redacted>/europe-west4-a/nat-gateway-europe-west4-a)
module.nat-gateway-zone-a.module.nat-gateway.null_resource.dummy_dependency: Creating...
  triggers.%:                 "" => "1"
  triggers.instance_template: "" => "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404170522053400000001"
module.nat-gateway-zone-a.module.nat-gateway.null_resource.dummy_dependency: Creation complete after 0s (ID: 1413602574045351781)
module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_template.default: Creating...
  can_ip_forward:                                      "" => "true"
  disk.#:                                              "" => "1"
  disk.0.auto_delete:                                  "" => "true"
  disk.0.boot:                                         "" => "true"
  disk.0.device_name:                                  "" => "<computed>"
  disk.0.disk_size_gb:                                 "" => "0"
  disk.0.disk_type:                                    "" => "pd-ssd"
  disk.0.interface:                                    "" => "<computed>"
  disk.0.mode:                                         "" => "<computed>"
  disk.0.source_image:                                 "" => "debian-cloud/debian-9"
  disk.0.type:                                         "" => "PERSISTENT"
  labels.%:                                            "" => "1"
  labels.app:                                          "" => "nat-gateway"
  machine_type:                                        "" => "n1-standard-2"
  metadata.%:                                          "" => "2"
  metadata.startup-script:                             "" => <redacted>
  metadata.tf_depends_id:                              "" => "1413602574045351781"
  metadata_fingerprint:                                "" => "<computed>"
  name:                                                "" => "<computed>"
  name_prefix:                                         "" => "default-"
  network_interface.#:                                 "" => "1"
  network_interface.0.access_config.#:                 "" => "1"
  network_interface.0.access_config.0.assigned_nat_ip: "" => "<computed>"
  network_interface.0.access_config.0.nat_ip:          "" => <redacted>
  network_interface.0.access_config.0.network_tier:    "" => "<computed>"
  network_interface.0.address:                         "" => "<computed>"
  network_interface.0.network_ip:                      "" => "10.207.160.36"
  network_interface.0.subnetwork:                      "" => "delivery-platform-general"
  network_interface.0.subnetwork_project:              "" => "<computed>"
  project:                                             "" => "<computed>"
  region:                                              "" => "europe-west4"
  scheduling.#:                                        "" => "<computed>"
  self_link:                                           "" => "<computed>"
  service_account.#:                                   "" => "1"
  service_account.0.email:                             "" => "default"
  service_account.0.scopes.#:                          "" => "4"
  service_account.0.scopes.1693978638:                 "" => "https://www.googleapis.com/auth/devstorage.full_control"
  service_account.0.scopes.172152165:                  "" => "https://www.googleapis.com/auth/logging.write"
  service_account.0.scopes.299962681:                  "" => "https://www.googleapis.com/auth/compute"
  service_account.0.scopes.4177124133:                 "" => "https://www.googleapis.com/auth/monitoring.write"
  tags.#:                                              "" => "3"
  tags.2086117779:                                     "" => "inst-nat-europe-west4-b"
  tags.2508137496:                                     "" => "inst-nat-europe-west4"
  tags.2542268873:                                     "" => "allow-ssh"
  tags_fingerprint:                                    "" => "<computed>"
module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_template.default: Creation complete after 4s (ID: default-20190404170530839100000002)
module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_group_manager.default: Modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b)
  version.0.instance_template: "https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404165934489100000001" => "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404170530839100000002"
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 10s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 20s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 30s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 40s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 50s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 1m0s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 1m10s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 1m20s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 1m30s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 1m40s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 1m50s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 2m0s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 2m10s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 2m20s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 2m30s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 2m40s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 2m50s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 3m0s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 3m10s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 3m20s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 3m30s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 3m40s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 3m50s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 4m0s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 4m10s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 4m20s elapsed)
module.nat-gateway-zone-b.nat-gateway.google_compute_instance_group_manager.default: Still modifying... (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b, 4m30s elapsed)
module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_group_manager.default: Modifications complete after 4m32s (ID: <redacted>/europe-west4-b/nat-gateway-europe-west4-b)
module.nat-gateway-zone-b.module.nat-gateway.null_resource.dummy_dependency: Creating...
  triggers.%:                 "" => "1"
  triggers.instance_template: "" => "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404170530839100000002"
module.nat-gateway-zone-b.module.nat-gateway.null_resource.dummy_dependency: Creation complete after 0s (ID: 3710875432525215501)
module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_template.default: Creating...
  can_ip_forward:                                      "" => "true"
  disk.#:                                              "" => "1"
  disk.0.auto_delete:                                  "" => "true"
  disk.0.boot:                                         "" => "true"
  disk.0.device_name:                                  "" => "<computed>"
  disk.0.disk_size_gb:                                 "" => "0"
  disk.0.disk_type:                                    "" => "pd-ssd"
  disk.0.interface:                                    "" => "<computed>"
  disk.0.mode:                                         "" => "<computed>"
  disk.0.source_image:                                 "" => "debian-cloud/debian-9"
  disk.0.type:                                         "" => "PERSISTENT"
  labels.%:                                            "" => "1"
  labels.app:                                          "" => "nat-gateway"
  machine_type:                                        "" => "n1-standard-2"
  metadata.%:                                          "" => "2"
  metadata.startup-script:                             "" => <redacted>
  metadata.tf_depends_id:                              "" => "3710875432525215501"
  metadata_fingerprint:                                "" => "<computed>"
  name:                                                "" => "<computed>"
  name_prefix:                                         "" => "default-"
  network_interface.#:                                 "" => "1"
  network_interface.0.access_config.#:                 "" => "1"
  network_interface.0.access_config.0.assigned_nat_ip: "" => "<computed>"
  network_interface.0.access_config.0.nat_ip:          "" => <redacted>
  network_interface.0.access_config.0.network_tier:    "" => "<computed>"
  network_interface.0.address:                         "" => "<computed>"
  network_interface.0.network_ip:                      "" => "10.207.160.35"
  network_interface.0.subnetwork:                      "" => "delivery-platform-general"
  network_interface.0.subnetwork_project:              "" => "<computed>"
  project:                                             "" => "<computed>"
  region:                                              "" => "europe-west4"
  scheduling.#:                                        "" => "<computed>"
  self_link:                                           "" => "<computed>"
  service_account.#:                                   "" => "1"
  service_account.0.email:                             "" => "default"
  service_account.0.scopes.#:                          "" => "4"
  service_account.0.scopes.1693978638:                 "" => "https://www.googleapis.com/auth/devstorage.full_control"
  service_account.0.scopes.172152165:                  "" => "https://www.googleapis.com/auth/logging.write"
  service_account.0.scopes.299962681:                  "" => "https://www.googleapis.com/auth/compute"
  service_account.0.scopes.4177124133:                 "" => "https://www.googleapis.com/auth/monitoring.write"
  tags.#:                                              "" => "3"
  tags.189829381:                                      "" => "inst-nat-europe-west4-c"
  tags.2508137496:                                     "" => "inst-nat-europe-west4"
  tags.2542268873:                                     "" => "allow-ssh"
  tags_fingerprint:                                    "" => "<computed>"
module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_template.default: Creation complete after 4s (ID: default-20190404171006351000000003)
module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_group_manager.default: Modifying... (ID: <redacted>/europe-west4-c/nat-gateway-europe-west4-c)
  version.0.instance_template: "https://www.googleapis.com/compute/v1/projects/<redacted>/global/instanceTemplates/default-20190404165948392600000002" => "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404171006351000000003"
module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_group_manager.default: Modifications complete after 5s (ID: <redacted>/europe-west4-c/nat-gateway-europe-west4-c)
module.nat-gateway-zone-c.module.nat-gateway.null_resource.dummy_dependency: Creating...
  triggers.%:                 "" => "1"
  triggers.instance_template: "" => "https://www.googleapis.com/compute/beta/projects/<redacted>/global/instanceTemplates/default-20190404171006351000000003"
module.nat-gateway-zone-c.module.nat-gateway.null_resource.dummy_dependency: Creation complete after 0s (ID: 1253033372565661367)
module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_template.default.deposed: Destroying... (ID: default-20190404165948392600000002)
module.nat-gateway-zone-c.module.nat-gateway.google_compute_instance_template.default.deposed: Destruction complete after 3s
module.nat-gateway-zone-b.module.nat-gateway.null_resource.dummy_dependency.deposed: Destroying... (ID: 5243515173846081974)
module.nat-gateway-zone-b.module.nat-gateway.null_resource.dummy_dependency.deposed: Destruction complete after 0s
module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_template.default.deposed: Destroying... (ID: default-20190404165934489100000001)
module.nat-gateway-zone-b.module.nat-gateway.google_compute_instance_template.default.deposed: Destruction complete after 3s
module.nat-gateway-zone-a.module.nat-gateway.null_resource.dummy_dependency.deposed: Destroying... (ID: 7710320696792349225)
module.nat-gateway-zone-a.module.nat-gateway.null_resource.dummy_dependency.deposed: Destruction complete after 0s
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default.deposed: Destroying... (ID: default-20190404165417483900000002)
module.nat-gateway-zone-a.module.nat-gateway.google_compute_instance_template.default.deposed: Destruction complete after 3s

Apply complete! Resources: 6 added, 3 changed, 6 destroyed.

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

@venkykuberan venkykuberan self-assigned this Jan 17, 2020
@nat-henderson
Copy link
Contributor

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.

@ghost
Copy link

ghost commented Mar 28, 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. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants