diff --git a/google/resource_compute_backend_service_test.go b/google/resource_compute_backend_service_test.go index 618a7b79..c0a8944d 100644 --- a/google/resource_compute_backend_service_test.go +++ b/google/resource_compute_backend_service_test.go @@ -171,6 +171,27 @@ func TestAccComputeBackendService_withConnectionDrainingAndUpdate(t *testing.T) } } +func TestAccComputeBackendService_withHttpsHealthCheck(t *testing.T) { + serviceName := fmt.Sprintf("tf-test-%s", acctest.RandString(10)) + checkName := fmt.Sprintf("tf-test-%s", acctest.RandString(10)) + var svc compute.BackendService + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckComputeBackendServiceDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccComputeBackendService_withHttpsHealthCheck(serviceName, checkName), + Check: resource.ComposeTestCheckFunc( + testAccCheckComputeBackendServiceExists( + "google_compute_backend_service.foobar", &svc), + ), + }, + }, + }) +} + func testAccCheckComputeBackendServiceDestroy(s *terraform.State) error { config := testAccProvider.Meta().(*Config) @@ -416,3 +437,20 @@ resource "google_compute_http_health_check" "zero" { } `, serviceName, drainingTimeout, checkName) } + +func testAccComputeBackendService_withHttpsHealthCheck(serviceName, checkName string) string { + return fmt.Sprintf(` +resource "google_compute_backend_service" "foobar" { + name = "%s" + health_checks = ["${google_compute_https_health_check.zero.self_link}"] + protocol = "HTTPS" +} + +resource "google_compute_https_health_check" "zero" { + name = "%s" + request_path = "/" + check_interval_sec = 1 + timeout_sec = 1 +} +`, serviceName, checkName) +} diff --git a/website/docs/r/compute_region_backend_service.html.markdown b/website/docs/r/compute_region_backend_service.html.markdown index caec21fc..f73e0830 100644 --- a/website/docs/r/compute_region_backend_service.html.markdown +++ b/website/docs/r/compute_region_backend_service.html.markdown @@ -69,7 +69,7 @@ The following arguments are supported: * `name` - (Required) The name of the backend service. -* `health_checks` - (Required) Specifies a list of HTTP/HTTPS health checks +* `health_checks` - (Required) Specifies a list of health checks for checking the health of the backend service. Currently at most one health check can be specified, and a health check is required.