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

Creating HA google_redis_instance doesn't seem to store auto-generated alternative_location_id #1669

Closed
reidab opened this issue Jun 18, 2018 · 1 comment · Fixed by GoogleCloudPlatform/magic-modules#296
Labels

Comments

@reidab
Copy link

reidab commented Jun 18, 2018

Terraform Version

Terraform v0.11.7
+ provider.google v1.14.0

Affected Resource(s)

  • google_redis_instance

Terraform Configuration Files

resource "google_redis_instance" "production" {
  name = "redis-production"
  memory_size_gb = 1
  tier = "STANDARD_HA"
  region = "us-central1"
  location_id = "us-central1-a"
  authorized_network = "${google_compute_network.the_dyrt.self_link}"
}

Expected Behavior

When creating a google_redis_instance without specifying alternative_location_id, the alternative location is automatically assigned. I'd expect this computed value to be persisted to the state in such a way that subsequent updates didn't try to clear it.

Actual Behavior

On subsequent terraform apply runs with no other related changes, terraform wants to recreate the instance to set alternative_location_id back to a blank string:

Terraform will perform the following actions:

-/+ module.google_cloud.google_redis_instance.production (new resource required)
      id:                          "the-dyrt/us-central1/redis-production" => <computed> (forces new resource)
      alternative_location_id:     "us-central1-b" => "" (forces new resource)
      authorized_network:          "projects/the-dyrt/global/networks/the-dyrt" => "https://www.googleapis.com/compute/v1/projects/the-dyrt/global/networks/the-dyrt"
      create_time:                 "2018-06-18T22:26:15.486557Z" => <computed>
      current_location_id:         "us-central1-a" => <computed>
      host:                        "10.18.0.12" => <computed>
      location_id:                 "us-central1-a" => "us-central1-a"
      memory_size_gb:              "1" => "1"
      name:                        "redis-production" => "redis-production"
      port:                        "6379" => <computed>
      project:                     "the-dyrt" => <computed>
      redis_version:               "REDIS_3_2" => <computed>
      region:                      "us-central1" => "us-central1"
      reserved_ip_range:           "10.18.0.8/29" => <computed>
      tier:                        "STANDARD_HA" => "STANDARD_HA"

Manually modifying the instance specification and setting alternative_location_id = "us-central1-b" to match the generated value works around this and terraform no longer desires to recreate the instance.

Steps to Reproduce

  1. Specify a STANDARD_HA redis instance without an explicit alternative_location_id
  2. terraform apply
  3. terraform apply
@ghost
Copy link

ghost commented Nov 17, 2018

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 Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants