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

google_compute_region_backend_service : Every plan show a diff even after multiple apply #1375

Closed
noogg opened this issue Apr 24, 2018 · 3 comments · Fixed by #1549
Closed
Labels

Comments

@noogg
Copy link

noogg commented Apr 24, 2018

Terraform Version

Terraform v0.11.7
+ provider.google v1.10.0

Affected Resource(s)

  • google_compute_region_backend_service
  • google_compute_region_instance_group_manager

Terraform Configuration Files

resource "google_compute_health_check" "test" {
  name = "test"

  tcp_health_check {
    port = "3128"
  }
}

resource "google_compute_instance_template" "test" {
  name   = "test"
  region = "us-east1"

  machine_type = "n1-standard-1"

  disk {
    device_name  = "persistent-disk-0"
    source_image = "centos-cloud/centos-7"
    auto_delete  = true
    boot         = true
  }

  network_interface = {
    subnetwork = "default"
  }
}

resource "google_compute_region_instance_group_manager" "test" {
  name   = "test"
  region = "us-east1"

  base_instance_name = "test"
  instance_template  = "${google_compute_instance_template.test.self_link}"
  target_size        = 2

  auto_healing_policies {
    health_check      = "${google_compute_health_check.test.self_link}"
    initial_delay_sec = 120
  }
}

resource "google_compute_region_backend_service" "test" {
  name     = "test"
  region   = "us-east1"
  protocol = "TCP"

  backend {
    group = "${google_compute_region_instance_group_manager.test.instance_group}"
  }

  health_checks = ["${google_compute_health_check.test.self_link}"]
}

Debug Output

https://gist.github.com/noogg/317bfb95fe1fcbc604f7e6aee31d532f
https://gist.github.com/noogg/d2aba84f35086b9d5366d34d1106ffbe
https://gist.github.com/noogg/59069679333dbd90f53134a3c78309a4

Expected Behavior

After the first apply run successfully (and neither the infrastructure nor the configuration is modified) I shouldn't see any difference on subsequent plan execution.

Actual Behavior

After the first apply run successfully (and neither the infrastructure nor the configuration is modified) every plan execution show a difference and those even after multiple subsequent apply run successfully.

Steps to Reproduce

⚠️ (This issue start since version v1.8.0 of the google provider and happen only when auto_healing_policies is active on google_compute_region_instance_group_manager ) ⚠️

  1. terraform apply
  2. terraform plan
@paddycarver
Copy link
Contributor

It looks like we're setting the backend group using a beta self_link in state when beta APIs are used.

We should probably just normalize it to a v1 self_link.

@ffilippopoulos
Copy link

+1 We are seeing the same behaviour when defining a google_compute_region_backend_service using a backend from a google_compute_region_instance_group_manager that has a rolling_update_policy.

@paddycarver did you guys managed to work around this?

@ghost
Copy link

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

@ghost ghost unassigned rosbo Nov 18, 2018
@ghost ghost locked and limited conversation to collaborators Nov 18, 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.

4 participants