diff --git a/.changelog/4143.txt b/.changelog/4143.txt new file mode 100644 index 0000000000..737c38732d --- /dev/null +++ b/.changelog/4143.txt @@ -0,0 +1,3 @@ +```release-note:bug +compute: fixed an issue where `google_compute_health_check` `port` values caused a diff when `port_specification` was unset or set to `""` +``` diff --git a/google-beta/resource_compute_health_check.go b/google-beta/resource_compute_health_check.go index a1740b44c0..bd0bb880f3 100644 --- a/google-beta/resource_compute_health_check.go +++ b/google-beta/resource_compute_health_check.go @@ -101,7 +101,7 @@ func portDiffSuppress(k, old, new string, d *schema.ResourceData) bool { newPort, _ := strconv.Atoi(new) portSpec := d.Get(b[0] + ".0.port_specification") - if int64(oldPort) == defaultPort && newPort == 0 && portSpec == "USE_FIXED_PORT" { + if int64(oldPort) == defaultPort && newPort == 0 && (portSpec == "USE_FIXED_PORT" || portSpec == "") { return true } }