{"action":"closed","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1981","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1981/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1981/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/issues/1981/events","html_url":"https://github.com/terraform-providers/terraform-provider-google/issues/1981","id":356764697,"node_id":"MDU6SXNzdWUzNTY3NjQ2OTc=","number":1981,"title":"google_compute_instance_group_manager Required field 'instanceTemplate' not specified, required","user":{"login":"hashibot[bot]","id":35615658,"node_id":"MDM6Qm90MzU2MTU2NTg=","avatar_url":"https://avatars2.githubusercontent.com/in/8332?v=4","gravatar_id":"","url":"https://api.github.com/users/hashibot%5Bbot%5D","html_url":"https://github.com/apps/hashibot","followers_url":"https://api.github.com/users/hashibot%5Bbot%5D/followers","following_url":"https://api.github.com/users/hashibot%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/hashibot%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/hashibot%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashibot%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/hashibot%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/hashibot%5Bbot%5D/repos","events_url":"https://api.github.com/users/hashibot%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/hashibot%5Bbot%5D/received_events","type":"Bot","site_admin":false},"labels":[{"id":620326519,"node_id":"MDU6TGFiZWw2MjAzMjY1MTk=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-google/labels/bug","name":"bug","color":"f7c6c7","default":true}],"state":"closed","locked":false,"assignee":{"login":"danawillow","id":1130694,"node_id":"MDQ6VXNlcjExMzA2OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1130694?v=4","gravatar_id":"","url":"https://api.github.com/users/danawillow","html_url":"https://github.com/danawillow","followers_url":"https://api.github.com/users/danawillow/followers","following_url":"https://api.github.com/users/danawillow/following{/other_user}","gists_url":"https://api.github.com/users/danawillow/gists{/gist_id}","starred_url":"https://api.github.com/users/danawillow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danawillow/subscriptions","organizations_url":"https://api.github.com/users/danawillow/orgs","repos_url":"https://api.github.com/users/danawillow/repos","events_url":"https://api.github.com/users/danawillow/events{/privacy}","received_events_url":"https://api.github.com/users/danawillow/received_events","type":"User","site_admin":false},"assignees":[{"login":"danawillow","id":1130694,"node_id":"MDQ6VXNlcjExMzA2OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1130694?v=4","gravatar_id":"","url":"https://api.github.com/users/danawillow","html_url":"https://github.com/danawillow","followers_url":"https://api.github.com/users/danawillow/followers","following_url":"https://api.github.com/users/danawillow/following{/other_user}","gists_url":"https://api.github.com/users/danawillow/gists{/gist_id}","starred_url":"https://api.github.com/users/danawillow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danawillow/subscriptions","organizations_url":"https://api.github.com/users/danawillow/orgs","repos_url":"https://api.github.com/users/danawillow/repos","events_url":"https://api.github.com/users/danawillow/events{/privacy}","received_events_url":"https://api.github.com/users/danawillow/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-09-04T11:20:02Z","updated_at":"2018-11-15T00:06:56Z","closed_at":"2018-11-15T00:06:55Z","author_association":"NONE","body":"_This issue was originally opened by @pgrange as hashicorp/terraform#18781. It was migrated here as a result of the [provider split](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/). The original body of the issue is below._\r\n\r\n<hr>\r\n\r\n<!--\r\nHi there,\r\n\r\nThank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.\r\n\r\nIf your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers .\r\n-->\r\n\r\nI try to use version blocks in [google_compute_instance_group_manager](https://www.terraform.io/docs/providers/google/r/compute_instance_group_manager.html). It succeeds on the first run on a fresh project but other runs fail with 400 error because of missing instanceTemplate.\r\n\r\n### Terraform Version\r\n<!---\r\nRun `terraform -v` to show the version, and paste the result between the ``` marks below.\r\n\r\nIf you are not running the latest version of Terraform, please try upgrading because your issue may have already been fixed.\r\n-->\r\n\r\n```\r\nterraform -v\r\nTerraform v0.11.8\r\n+ provider.google v1.17.1\r\n```\r\n\r\n### Terraform Configuration Files\r\n<!--\r\nPaste the relevant parts of your Terraform configuration between the ``` marks below.\r\n\r\nFor large Terraform configs, please use a service like Dropbox and share a link to the ZIP file. For security, you can also encrypt the files using our GPG public key.\r\n-->\r\n\r\n```hcl\r\nprovider \"google\" {\r\n  credentials = \"${file(\".key.json\")}\"\r\n  project     = \"project\"\r\n  region      = \"europe-west1\"\r\n}\r\n\r\nresource \"google_compute_instance_template\" \"application-1\" {\r\n  name                 = \"application-1\"\r\n  machine_type         = \"f1-micro\"\r\n  disk {\r\n    source_image = \"ubuntu-1804-lts\"\r\n    auto_delete  = true\r\n    boot         = true\r\n    disk_size_gb = 10\r\n  }\r\n  network_interface {\r\n    subnetwork = \"default\"\r\n    access_config {\r\n      // Ephemeral IP\r\n    }\r\n  }\r\n}\r\n\r\nresource \"google_compute_instance_group_manager\" \"application\" {\r\n  name               = \"application\"\r\n  base_instance_name = \"application\"\r\n  zone               = \"europe-west1-d\"\r\n  update_strategy    = \"NONE\"\r\n  target_size        = 2\r\n\r\n  version {\r\n    name = \"a_name\"\r\n    instance_template  = \"${google_compute_instance_template.application-1.self_link}\"\r\n  }\r\n}\r\n```\r\n\r\n### Debug Output\r\n<!--\r\nFull debug output can be obtained by running Terraform with the environment variable `TF_LOG=trace`. Please create a GitHub Gist containing the debug output. Please do _not_ paste the debug output in the issue, since debug output is long.\r\n\r\nDebug output may contain sensitive information. Please review it before posting publicly, and if you are concerned feel free to encrypt the files using the HashiCorp security public key.\r\n-->\r\n\r\n### Crash Output\r\n<!--\r\nIf the console output indicates that Terraform crashed, please share a link to a GitHub Gist containing the output of the `crash.log` file.\r\n-->\r\n\r\n### Expected Behavior\r\n<!--\r\nWhat should have happened?\r\n-->\r\n\r\nRunning terraform apply several times should succeed with no modifications.\r\n\r\n### Actual Behavior\r\n<!--\r\nWhat actually happened?\r\n-->\r\n\r\nRunning terraform several times succeed the first time but fail after that.\r\n\r\n### Steps to Reproduce\r\n<!--\r\nPlease list the full steps required to reproduce the issue, for example:\r\n1. `terraform init`\r\n2. `terraform apply`\r\n-->\r\n\r\n```\r\n#> terraform init && terraform destroy && terraform apply && terraform apply\r\n\r\nInitializing provider plugins...\r\n- Checking for available provider plugins on https://releases.hashicorp.com...\r\n- Downloading plugin for provider \"google\" (1.17.1)...\r\n\r\nThe following providers do not have any version constraints in configuration,\r\nso the latest version was installed.\r\n\r\nTo prevent automatic upgrades to new major versions that may contain breaking\r\nchanges, it is recommended to add version = \"...\" constraints to the\r\ncorresponding provider blocks in configuration, with the constraint strings\r\nsuggested below.\r\n\r\n* provider.google: version = \"~> 1.17\"\r\n\r\nTerraform has been successfully initialized!\r\n\r\nYou may now begin working with Terraform. Try running \"terraform plan\" to see\r\nany changes that are required for your infrastructure. All Terraform commands\r\nshould now work.\r\n\r\nIf you ever set or change modules or backend configuration for Terraform,\r\nrerun this command to reinitialize your working directory. If you forget, other\r\ncommands will detect it and remind you to do so if necessary.\r\nDo you really want to destroy all resources?\r\n  Terraform will destroy all your managed infrastructure, as shown above.\r\n  There is no undo. Only 'yes' will be accepted to confirm.\r\n\r\n  Enter a value: yes\r\n\r\n\r\nDestroy complete! Resources: 0 destroyed.\r\n\r\nAn execution plan has been generated and is shown below.\r\nResource actions are indicated with the following symbols:\r\n  + create\r\n\r\nTerraform will perform the following actions:\r\n\r\n  + google_compute_instance_group_manager.application\r\n      id:                                                  <computed>\r\n      base_instance_name:                                  \"application\"\r\n      fingerprint:                                         <computed>\r\n      instance_group:                                      <computed>\r\n      name:                                                \"application\"\r\n      project:                                             <computed>\r\n      self_link:                                           <computed>\r\n      target_size:                                         \"2\"\r\n      update_strategy:                                     \"NONE\"\r\n      version.#:                                           \"1\"\r\n      version.0.instance_template:                         \"${google_compute_instance_template.application-1.self_link}\"\r\n      version.0.name:                                      \"a_name\"\r\n      wait_for_instances:                                  \"false\"\r\n      zone:                                                \"europe-west1-d\"\r\n\r\n  + google_compute_instance_template.application-1\r\n      id:                                                  <computed>\r\n      can_ip_forward:                                      \"false\"\r\n      disk.#:                                              \"1\"\r\n      disk.0.auto_delete:                                  \"true\"\r\n      disk.0.boot:                                         \"true\"\r\n      disk.0.device_name:                                  <computed>\r\n      disk.0.disk_size_gb:                                 \"10\"\r\n      disk.0.disk_type:                                    <computed>\r\n      disk.0.interface:                                    <computed>\r\n      disk.0.mode:                                         <computed>\r\n      disk.0.source_image:                                 \"ubuntu-1804-lts\"\r\n      disk.0.type:                                         <computed>\r\n      machine_type:                                        \"f1-micro\"\r\n      metadata_fingerprint:                                <computed>\r\n      name:                                                \"application-1\"\r\n      name_prefix:                                         <computed>\r\n      network_interface.#:                                 \"1\"\r\n      network_interface.0.access_config.#:                 \"1\"\r\n      network_interface.0.access_config.0.assigned_nat_ip: <computed>\r\n      network_interface.0.access_config.0.nat_ip:          <computed>\r\n      network_interface.0.access_config.0.network_tier:    <computed>\r\n      network_interface.0.address:                         <computed>\r\n      network_interface.0.network_ip:                      <computed>\r\n      network_interface.0.subnetwork:                      \"default\"\r\n      network_interface.0.subnetwork_project:              <computed>\r\n      project:                                             <computed>\r\n      region:                                              <computed>\r\n      scheduling.#:                                        <computed>\r\n      self_link:                                           <computed>\r\n      tags_fingerprint:                                    <computed>\r\n\r\n\r\nPlan: 2 to add, 0 to change, 0 to destroy.\r\n\r\nDo you want to perform these actions?\r\n  Terraform will perform the actions described above.\r\n  Only 'yes' will be accepted to approve.\r\n\r\n  Enter a value: yes\r\n\r\ngoogle_compute_instance_template.application-1: Creating...\r\n  can_ip_forward:                                      \"\" => \"false\"\r\n  disk.#:                                              \"\" => \"1\"\r\n  disk.0.auto_delete:                                  \"\" => \"true\"\r\n  disk.0.boot:                                         \"\" => \"true\"\r\n  disk.0.device_name:                                  \"\" => \"<computed>\"\r\n  disk.0.disk_size_gb:                                 \"\" => \"10\"\r\n  disk.0.disk_type:                                    \"\" => \"<computed>\"\r\n  disk.0.interface:                                    \"\" => \"<computed>\"\r\n  disk.0.mode:                                         \"\" => \"<computed>\"\r\n  disk.0.source_image:                                 \"\" => \"ubuntu-1804-lts\"\r\n  disk.0.type:                                         \"\" => \"<computed>\"\r\n  machine_type:                                        \"\" => \"f1-micro\"\r\n  metadata_fingerprint:                                \"\" => \"<computed>\"\r\n  name:                                                \"\" => \"application-1\"\r\n  name_prefix:                                         \"\" => \"<computed>\"\r\n  network_interface.#:                                 \"\" => \"1\"\r\n  network_interface.0.access_config.#:                 \"\" => \"1\"\r\n  network_interface.0.access_config.0.assigned_nat_ip: \"\" => \"<computed>\"\r\n  network_interface.0.access_config.0.nat_ip:          \"\" => \"<computed>\"\r\n  network_interface.0.access_config.0.network_tier:    \"\" => \"<computed>\"\r\n  network_interface.0.address:                         \"\" => \"<computed>\"\r\n  network_interface.0.network_ip:                      \"\" => \"<computed>\"\r\n  network_interface.0.subnetwork:                      \"\" => \"default\"\r\n  network_interface.0.subnetwork_project:              \"\" => \"<computed>\"\r\n  project:                                             \"\" => \"<computed>\"\r\n  region:                                              \"\" => \"<computed>\"\r\n  scheduling.#:                                        \"\" => \"<computed>\"\r\n  self_link:                                           \"\" => \"<computed>\"\r\n  tags_fingerprint:                                    \"\" => \"<computed>\"\r\ngoogle_compute_instance_template.application-1: Still creating... (10s elapsed)\r\ngoogle_compute_instance_template.application-1: Creation complete after 13s (ID: application-1)\r\ngoogle_compute_instance_group_manager.application: Creating...\r\n  base_instance_name:          \"\" => \"application\"\r\n  fingerprint:                 \"\" => \"<computed>\"\r\n  instance_group:              \"\" => \"<computed>\"\r\n  name:                        \"\" => \"application\"\r\n  project:                     \"\" => \"<computed>\"\r\n  self_link:                   \"\" => \"<computed>\"\r\n  target_size:                 \"\" => \"2\"\r\n  update_strategy:             \"\" => \"NONE\"\r\n  version.#:                   \"\" => \"1\"\r\n  version.0.instance_template: \"\" => \"https://www.googleapis.com/compute/beta/projects/lgo-gce/global/instanceTemplates/application-1\"\r\n  version.0.name:              \"\" => \"a_name\"\r\n  wait_for_instances:          \"\" => \"false\"\r\n  zone:                        \"\" => \"europe-west1-d\"\r\ngoogle_compute_instance_group_manager.application: Still creating... (10s elapsed)\r\ngoogle_compute_instance_group_manager.application: Creation complete after 12s (ID: application)\r\n\r\nApply complete! Resources: 2 added, 0 changed, 0 destroyed.\r\ngoogle_compute_instance_template.application-1: Refreshing state... (ID: application-1)\r\ngoogle_compute_instance_group_manager.application: Refreshing state... (ID: application)\r\n\r\nAn execution plan has been generated and is shown below.\r\nResource actions are indicated with the following symbols:\r\n  ~ update in-place\r\n\r\nTerraform will perform the following actions:\r\n\r\n  ~ google_compute_instance_group_manager.application\r\n      instance_template: \"https://www.googleapis.com/compute/v1/projects/lgo-gce/global/instanceTemplates/application-1\" => \"\"\r\n\r\n\r\nPlan: 0 to add, 1 to change, 0 to destroy.\r\n\r\nDo you want to perform these actions?\r\n  Terraform will perform the actions described above.\r\n  Only 'yes' will be accepted to approve.\r\n\r\n  Enter a value: yes\r\n\r\ngoogle_compute_instance_group_manager.application: Modifying... (ID: application)\r\n  instance_template: \"https://www.googleapis.com/compute/v1/projects/lgo-gce/global/instanceTemplates/application-1\" => \"\"\r\n\r\nError: Error applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* google_compute_instance_group_manager.application: 1 error(s) occurred:\r\n\r\n* google_compute_instance_group_manager.application: Error updating InstanceGroupManager: googleapi: Error 400: Required field 'instanceTemplate' not specified, required\r\n\r\nTerraform does not automatically rollback in the face of errors.\r\nInstead, your Terraform state file has been partially updated with\r\nany resources that successfully completed. Please address the error\r\nabove and apply again to incrementally change your infrastructure.\r\n\r\n```\r\n\r\n### Additional Context\r\n<!--\r\nAre there anything atypical about your situation that we should know? For example: is Terraform running in a wrapper script or in a CI system? Are you passing any unusual command line options or environment variables to opt-in to non-default behavior?\r\n-->\r\n\r\n### References\r\n<!--\r\nAre there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:\r\n\r\n- hashicorp/terraform#6017\r\n\r\n-->\r\n"}}
{"actor":{"display_login":"danawillow"}}