Terraform-provider-google: Cannot clear "description" field of google_compute_health_check

Created on 6 Oct 2020  ·  7Comments  ·  Source: hashicorp/terraform-provider-google


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 -v
Terraform v0.13.4
+ provider registry.terraform.io/hashicorp/google v3.42.0

Affected Resource(s)

  • google_compute_health_check

Terraform Configuration Files

resource "google_compute_health_check" "tcp-health-check" {
  name = "tcp-health-check"

  timeout_sec        = 1
  check_interval_sec = 1

  tcp_health_check {
    port = "80"
  }
}

Debug Output

Full debug log: https://gist.github.com/pdecat/ac993f73cf163c34e3362f1ad827ac32

The PUT call does not submit an empty description:

2020-10-06T15:29:04.803+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: 2020/10/06 15:29:04 [DEBUG] Updating HealthCheck "projects/myproject/global/healthChecks/tcp-
health-check": map[string]interface {}{"checkIntervalSec":1, "healthyThreshold":2, "name":"tcp-health-check", "tcpHealthCheck":map[string]interface {}{"port":80, "proxyHeader":"NONE"},
"timeoutSec":1, "type":"TCP", "unhealthyThreshold":2}
2020-10-06T15:29:04.803+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: 2020/10/06 15:29:04 [DEBUG] Waiting for state to become: [success]
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: 2020/10/06 15:29:04 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: 2020/10/06 15:29:04 [DEBUG] Retry Transport: request attempt 0
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: 2020/10/06 15:29:04 [DEBUG] Google API Request Details:
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: ---[ REQUEST ]---------------------------------------
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: PUT /compute/v1/projects/myproject/global/healthChecks/tcp-health-check?alt=json HTTP/1.1
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: Host: compute.googleapis.com
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: User-Agent: Terraform/0.13.4 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-
google/3.42.0
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: Content-Length: 171
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: Content-Type: application/json
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: Accept-Encoding: gzip
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: {
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  "checkIntervalSec": 1,
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  "healthyThreshold": 2,
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  "name": "tcp-health-check",
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  "tcpHealthCheck": {
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:   "port": 80,
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:   "proxyHeader": "NONE"
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  },
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  "timeoutSec": 1,
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  "type": "TCP",
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:  "unhealthyThreshold": 2
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: }
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5:
2020-10-06T15:29:04.804+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: -----------------------------------------------------
2020-10-06T15:29:05.884+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: 2020/10/06 15:29:05 [DEBUG] Google API Response Details:
2020-10-06T15:29:05.884+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: ---[ RESPONSE ]--------------------------------------
2020-10-06T15:29:05.884+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: HTTP/1.1 200 OK
2020-10-06T15:29:05.884+0200 [DEBUG] plugin.terraform-provider-google_v3.42.0_x5: Connection: close

Panic Output


N/A

Expected Behavior


The description field that is not set in terraform configuration should be cleared.

Actual Behavior


The description field is not cleared, which generates a permanent diff on each plan.

Steps to Reproduce

  1. terraform apply -auto-approve
  2. gcloud compute health-checks update tcp tcp-health-check --description="OUT OF BAND CHANGE"
  3. terraform apply -auto-approve
  4. terraform plan

Important Factoids

The REST API does not explicitly states how to unset the description field: https://cloud.google.com/compute/docs/reference/rest/v1/healthChecks

But the gcloud CLI does:

--description=DESCRIPTION
A textual description for the TCP health check. Pass in an empty string to unset.

See https://cloud.google.com/sdk/gcloud/reference/compute/health-checks/update/tcp

References


N/A

bug

All 7 comments

I see the problem Here is another log

@pdecat we cut our releases on Wednesday and then they go out on Monday, so this will be in 3.44.0: https://github.com/hashicorp/terraform-provider-google/pull/7527/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR27

Oh :facepalm:

I've been away of the internals of this provider's development for some time.
Has this delayed release workflow been in place for long?

Yeah, I think we started around the beginning of 2020? It helps us make sure we get a release out at about the same time every week, and if there are issues with our integration tests we have a few days to resolve them.

Fix confirmed with v3.44.0, thanks!

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!

Was this page helpful?
0 / 5 - 0 ratings