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

Make zone field consistent and truly optional for all resources #914

Merged
merged 1 commit into from
Jan 3, 2018

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Jan 3, 2018

#816 enabled the zone field to be specified at the provider level.

However, a few resources such as google_compute_disk are setting the zone field in the read method. This was causing a perpetual diff if the zone was inferred from the provider default zone:

-/+ google_compute_disk.my-disk[0] (new resource required)
      disk_encryption_key_sha256: "" => "<computed>"
      label_fingerprint:          "42WmSpB8rSM=" => "<computed>"
      name:                       "my-disk-0" => "my-disk-0"
      project:                    "rosbo-personal" => "<computed>"
      self_link:                  "https://www.googleapis.com/compute/v1/projects/REDACTED/zones/us-central1-c/disks/my-disk-0" => "<computed>"
      size:                       "100" => "<computed>"
      type:                       "pd-ssd" => "pd-ssd"
      users.#:                    "0" => "<computed>"
      zone:                       "us-central1-c" => "" (forces new resource)

This fix marks all the zone field as Computed and is consistent about always setting the zone field in the state inside the read method.

cc/ @ndmckinley

@rosbo rosbo merged commit dab491d into hashicorp:master Jan 3, 2018
@rosbo rosbo deleted the provider-default-zone-fix branch January 3, 2018 21:18
modular-magician pushed a commit to modular-magician/terraform-provider-google that referenced this pull request Sep 27, 2019
@ghost
Copy link

ghost commented Mar 30, 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 👉 [email protected]. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants