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

Default Compute Health Check Port is null, should be 443 #7586

Assignees
Labels

Comments

@dv-tyler
Copy link

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 Provider Version

  • google = "~> 3"

Affected Resource(s)

  • google_compute_health_check

Terraform Configuration Files

resource "google_compute_health_check" "health" {
  check_interval_sec  = 5
  healthy_threshold   = 2
  timeout_sec         = 5
  unhealthy_threshold = 5

  https_health_check {
    request_path = "/-/health"
  }
}

Debug Output

Debug output is massive and has private info, the issue happens to be obvious from the plan output, included here:

# google_compute_health_check.health will be updated in-place
~ resource "google_compute_health_check" "health" {
      check_interval_sec  = 5
      healthy_threshold   = 2
      timeout_sec         = 5
      type                = "HTTPS"
      unhealthy_threshold = 5
   ~ https_health_check {
        - port         = 443 -> null
          proxy_header = "NONE"
          request_path = "/-/health"
       }
  }

Expected Behavior

There should be no resource change, as the code has not changed. The TF state value for the health_check port should be 443, not null by default.

Actual Behavior

While port in https_health_check is optional, the provider appears to set this state to null, while the API sets the value to 443. If the port is not explicitly set, the resource shows a modification on every plan or apply.

Steps to Reproduce

  1. Create a health check with an https_health_check config block
  2. Do not set the port
  3. terraform apply
  4. Observe that terraform plan indicates a resource modification is needed without any code change
@ghost ghost added the bug label Oct 20, 2020
@venkykuberan venkykuberan self-assigned this Oct 21, 2020
@venkykuberan
Copy link
Contributor

@dv-tyler actually Provider sends the default port value as 443 in API request (when config doesn't have port value) and updates the state with port value 443 as expected. However TF plan finds the difference between your config & state and shows the in-place update. To circumvent we have diff supress func for port but looks like its not working as expected. We will look into it.

@ghost
Copy link

ghost commented Nov 23, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.