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

Spurious Diff on quic_override attribute of google_compute_target_https_proxy #4859

Closed
samcgardner opened this issue Nov 11, 2019 · 5 comments
Assignees
Labels

Comments

@samcgardner
Copy link

samcgardner commented Nov 11, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

Terraform Version

Terraform v0.12.10
+ provider.google v2.14.0
+ provider.google-beta v2.14.0
+ provider.local v1.3.0
+ provider.null v2.1.2
+ provider.random v2.2.0

Affected Resource(s)

google_compute_target_https_proxy

Terraform Configuration Files

resource "google_dns_record_set" "service-dns-entry" {
  provider = "google-beta"

  name         = "${var.owner}.${var.dns-prefix}.REDACTED"
  type         = "A"
  ttl          = 3600
  managed_zone = "dns"
  rrdatas      = ["${google_compute_global_address.service-ip.address}"]
}

resource "google_compute_global_address" "service-ip" {
  name = "${var.owner}-ip"
}

resource "google_compute_global_forwarding_rule" "default" {
  provider = "google-beta"

  name       = "${var.owner}-forwarding-rule"
  target     = "${google_compute_target_https_proxy.service-target-proxy.self_link}"
  port_range = 443
  ip_address = google_compute_global_address.service-ip.address
}

resource "google_compute_target_https_proxy" "service-target-proxy" {
  provider = "google-beta"

  name    = "${var.owner}-target-proxy"
  url_map = "${google_compute_url_map.service-url-map.self_link}"
  ssl_certificates = [google_compute_managed_ssl_certificate.service-cert.self_link]
}

resource "google_compute_managed_ssl_certificate" "service-cert" {
  provider = "google-beta"

  name = "${var.owner}-ssl-cert"

  managed {
    domains = [
      "${var.owner}.${var.dns-prefix}.REDACTED"
    ]
  }
}

resource "google_compute_url_map" "service-url-map" {
  provider = "google-beta"

  name = "${var.owner}-url-map"

  default_service = "${google_compute_backend_service.service-backend.self_link}"
}


resource "google_compute_backend_service" "service-backend" {
  name        = "${var.owner}-be"
  port_name   = "http"
  protocol    = "HTTP"
  timeout_sec = 10

  security_policy = var.security-policy

  health_checks = ["${google_compute_health_check.service-hc.self_link}"]

  # Add NEGs created by GKE to the backend service
  provisioner "local-exec" {
    command = <<-EOF
  gcloud compute network-endpoint-groups list --project=${var.project-id} | grep ${var.owner} | while read line ; do
  NEG=$(echo $line | awk '{print $1}')
  ZONE=$(echo $line | awk '{print $2}')
  gcloud compute backend-services add-backend ${var.owner}-be --network-endpoint-group=$NEG --network-endpoint-group-zone=$ZONE --balancing-mode=RATE --max-rate-per-endpoint=999999 --project=${var.project-id} --global
  done
  EOF
  }

  lifecycle {
    ignore_changes = [
      backend,
    ]
  }
}

resource "google_compute_health_check" "service-hc" {
  name               = "${var.owner}-hc"
  check_interval_sec = 5
  timeout_sec        = 5

  http_health_check {
    request_path = var.healthcheck-path
    port         = var.healthcheck-port
  }
}

Expected Behavior

quic_override should be treated as a computed attribute when not set and left at its default value, "NONE".

Actual Behavior

  # module.prometheus-europe.google_compute_target_https_proxy.service-target-proxy will be updated in-place
  ~ resource "google_compute_target_https_proxy" "service-target-proxy" {
        creation_timestamp = "2019-09-18T09:24:25.533-07:00"
        id                 = "prometheus-europe-target-proxy"
        name               = "prometheus-europe-target-proxy"
        project            = "prod-777777"
        proxy_id           = 4313152859747116000
      - quic_override      = "NONE" -> null
        self_link          = "https://www.googleapis.com/compute/v1/projects/prod-777777/global/targetHttpsProxies/prometheus-europe-target-proxy"
        ssl_certificates   = [
            "https://www.googleapis.com/compute/v1/projects/prod-777777/global/sslCertificates/prometheus-europe-ssl-cert",
        ]
        url_map            = "https://www.googleapis.com/compute/v1/projects/prod-777777/global/urlMaps/prometheus-europe-url-map"
    }

Error: Error updating TargetHttpsProxy "prometheus-europe-target-proxy": googleapi: Error 400: Required field 'quicOverride' not specified, required

  on .terraform/modules/prometheus-europe/load-balanced-service/main.tf line 24, in resource "google_compute_target_https_proxy" "service-target-proxy":
  24: resource "google_compute_target_https_proxy" "service-target-proxy" {

Steps to Reproduce

Have a target https proxy created before quic_override was introduced and then run terraform apply

@ghost ghost added the bug label Nov 11, 2019
@rileykarson rileykarson self-assigned this Nov 11, 2019
@samcgardner
Copy link
Author

@rileykarson I'm happy to PR this if you want, I appreciate you're probably pretty busy. Just wanted to confirm the issue before shooting from the hip as I'm not an expert on writing terraform modules.

@rileykarson
Copy link
Collaborator

Can you try 2.17.0? #4574 seems similar, and I think GoogleCloudPlatform/magic-modules#2404 fixed this behaviour in that release.

@samcgardner
Copy link
Author

We've already worked around this and I don't want to revert that change and re-deploy to all our environments, so I can't verify that the change you're referencing fixes this issue. That said, I'm confident that it would, so unless you'd like input on verifying this fix I'm happy to close this issue and call it good.

@ghost ghost removed the waiting-response label Nov 15, 2019
@rileykarson
Copy link
Collaborator

Thanks! I'll close this out, let us know if you run into it again for whatever reason.

@ghost
Copy link

ghost commented Dec 16, 2019

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

No branches or pull requests

2 participants