From d65c4ebdfdafe06f3068c5a5a44cbf744d2b64ed Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 5 Oct 2020 11:11:50 -0700 Subject: [PATCH] Make RegionBackendService health checks optional (#4053) (#2547) Signed-off-by: Modular Magician --- .changelog/4053.txt | 3 ++ .../resource_compute_backend_service.go | 3 +- ...resource_compute_region_backend_service.go | 29 ++++++++++--------- .../r/compute_backend_service.html.markdown | 3 +- ...mpute_region_backend_service.html.markdown | 14 +++++---- 5 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 .changelog/4053.txt diff --git a/.changelog/4053.txt b/.changelog/4053.txt new file mode 100644 index 0000000000..73c8de0b24 --- /dev/null +++ b/.changelog/4053.txt @@ -0,0 +1,3 @@ +```release-note:bug +compute: Fixed an issue where `google_compute_region_backend_service` required `healthChecks` for a serverless network endpoint group. +``` diff --git a/google-beta/resource_compute_backend_service.go b/google-beta/resource_compute_backend_service.go index bbf6e2f8eb..18a40f6cd9 100644 --- a/google-beta/resource_compute_backend_service.go +++ b/google-beta/resource_compute_backend_service.go @@ -483,7 +483,8 @@ requests.`, for health checking this BackendService. Currently at most one health check can be specified. -A health check must be specified unless the backend service uses an internet NEG as a backend. +A health check must be specified unless the backend service uses an internet +or serverless NEG as a backend. For internal load balancing, a URL to a HealthCheck resource must be specified instead.`, MinItems: 1, diff --git a/google-beta/resource_compute_region_backend_service.go b/google-beta/resource_compute_region_backend_service.go index e267712613..41056a0755 100644 --- a/google-beta/resource_compute_region_backend_service.go +++ b/google-beta/resource_compute_region_backend_service.go @@ -136,19 +136,6 @@ func resourceComputeRegionBackendService() *schema.Resource { CustomizeDiff: customDiffRegionBackendService, Schema: map[string]*schema.Schema{ - "health_checks": { - Type: schema.TypeSet, - Required: true, - Description: `The set of URLs to HealthCheck resources for health checking -this RegionBackendService. Currently at most one health -check can be specified, and a health check is required.`, - MinItems: 1, - MaxItems: 1, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - Set: selfLinkRelativePathHash, - }, "name": { Type: schema.TypeString, Required: true, @@ -403,6 +390,22 @@ This field is only used with l4 load balancing.`, }, }, }, + "health_checks": { + Type: schema.TypeSet, + Optional: true, + Description: `The set of URLs to HealthCheck resources for health checking +this RegionBackendService. Currently at most one health +check can be specified. + +A health check must be specified unless the backend service uses an internet +or serverless NEG as a backend.`, + MinItems: 1, + MaxItems: 1, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Set: selfLinkRelativePathHash, + }, "load_balancing_scheme": { Type: schema.TypeString, Optional: true, diff --git a/website/docs/r/compute_backend_service.html.markdown b/website/docs/r/compute_backend_service.html.markdown index 17cf092929..fe5d975b41 100644 --- a/website/docs/r/compute_backend_service.html.markdown +++ b/website/docs/r/compute_backend_service.html.markdown @@ -244,7 +244,8 @@ The following arguments are supported: The set of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified. - A health check must be specified unless the backend service uses an internet NEG as a backend. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. For internal load balancing, a URL to a HealthCheck resource must be specified instead. * `iap` - diff --git a/website/docs/r/compute_region_backend_service.html.markdown b/website/docs/r/compute_region_backend_service.html.markdown index c7035f7e90..a166504c21 100644 --- a/website/docs/r/compute_region_backend_service.html.markdown +++ b/website/docs/r/compute_region_backend_service.html.markdown @@ -213,12 +213,6 @@ resource "google_compute_subnetwork" "default" { The following arguments are supported: -* `health_checks` - - (Required) - The set of URLs to HealthCheck resources for health checking - this RegionBackendService. Currently at most one health - check can be specified, and a health check is required. - * `name` - (Required) Name of the resource. Provided by the client when the resource is @@ -281,6 +275,14 @@ The following arguments are supported: Policy for failovers. Structure is documented below. +* `health_checks` - + (Optional) + The set of URLs to HealthCheck resources for health checking + this RegionBackendService. Currently at most one health + check can be specified. + A health check must be specified unless the backend service uses an internet + or serverless NEG as a backend. + * `load_balancing_scheme` - (Optional) Indicates what kind of load balancing this regional backend service