diff --git a/builtin/providers/google/resource_compute_http_health_check_test.go b/builtin/providers/google/resource_compute_http_health_check_test.go index ac98540dd..bc987af19 100644 --- a/builtin/providers/google/resource_compute_http_health_check_test.go +++ b/builtin/providers/google/resource_compute_http_health_check_test.go @@ -25,6 +25,32 @@ func TestAccComputeHttpHealthCheck_basic(t *testing.T) { }) } +func TestAccComputeHttpHealthCheck_update(t *testing.T) { + var healthCheck compute.HttpHealthCheck + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckComputeHttpHealthCheckDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccComputeHttpHealthCheck_update1, + Check: resource.ComposeTestCheckFunc( + testAccCheckComputeHttpHealthCheckExists( + "google_compute_http_health_check.foobar", &healthCheck), + ), + }, + resource.TestStep{ + Config: testAccComputeHttpHealthCheck_update2, + Check: resource.ComposeTestCheckFunc( + testAccCheckComputeHttpHealthCheckExists( + "google_compute_http_health_check.foobar", &healthCheck), + ), + }, + }, + }) +} + func testAccCheckComputeHttpHealthCheckDestroy(s *terraform.State) error { config := testAccProvider.Meta().(*Config) @@ -83,3 +109,22 @@ resource "google_compute_http_health_check" "foobar" { unhealthy_threshold = 3 } ` + +const testAccComputeHttpHealthCheck_update1 = ` +resource "google_compute_http_health_check" "foobar" { + name = "terraform-test" + description = "Resource created for Terraform acceptance testing" + request_path = "/not_default" +} +` + +/* Change description, restore request_path to default, and change +* thresholds from defaults */ +const testAccComputeHttpHealthCheck_update2 = ` +resource "google_compute_http_health_check" "foobar" { + name = "terraform-test" + description = "Resource updated for Terraform acceptance testing" + healthy_threshold = 10 + unhealthy_threshold = 10 +} +`