Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

compute_image forces re-creation of compute_instance_template on every terraform plan/apply #28

Closed
idsvandermolen opened this issue Sep 19, 2018 · 3 comments

Comments

@idsvandermolen
Copy link

I have to specify

module "nat-zone1" {
  ...
  compute_image = "projects/debian-cloud/global/images/family/debian-9"
  ...
}

to override default debian-cloud/debian-9 compute_image, because otherwise terraform thinks the compute instance template has changed and needs to be recreated every terraform plan or apply:

-/+ module.main.module.nat-zone-1.module.nat-gateway.google_compute_instance_template.default (new resource required)
      id:                                                  "default-20180919081152445300000003" => <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" (forces new resource)
      disk.0.type:                                         "PERSISTENT" => "PERSISTENT"
      machine_type:                                        "f1-micro" => "f1-micro"

Terraform version used:

terraform --version
Terraform v0.11.8
+ provider.google v1.18.0
+ provider.null v1.0.0
+ provider.random v2.0.0
+ provider.template v1.0.0
@danisla
Copy link
Contributor

danisla commented Sep 21, 2018

Thanks for reporting this. Unfortunately this is an upstream provider bug, see: hashicorp/terraform-provider-google#1995

I'll see if there is some workaround in the meantime.

@danisla
Copy link
Contributor

danisla commented Sep 26, 2018

We fixed this in the nat gw module with GoogleCloudPlatform/terraform-google-nat-gateway#93

I'll create a similar patch for this module.

@idsvandermolen
Copy link
Author

thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants