From aaa1aa54af461083368bf96dfe8f8ac4a6be0c0c Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 6 Nov 2018 15:27:56 -0800 Subject: [PATCH] Remove backend_service.custom_request_headers from the GA provider (#2405) /cc @rileykarson --- google/resource_compute_backend_service.go | 13 +++-- .../resource_compute_backend_service_test.go | 49 ------------------- 2 files changed, 6 insertions(+), 56 deletions(-) diff --git a/google/resource_compute_backend_service.go b/google/resource_compute_backend_service.go index fd747ed57e5..b2180acc009 100644 --- a/google/resource_compute_backend_service.go +++ b/google/resource_compute_backend_service.go @@ -159,11 +159,11 @@ func resourceComputeBackendService() *schema.Resource { }, "custom_request_headers": &schema.Schema{ - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, + Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, }, "description": &schema.Schema{ @@ -322,8 +322,8 @@ func resourceComputeBackendServiceRead(d *schema.ResourceData, meta interface{}) return err } d.Set("security_policy", service.SecurityPolicy) - d.Set("custom_request_headers", service.CustomRequestHeaders) + d.Set("custom_request_headers", nil) return nil } @@ -532,7 +532,6 @@ func expandBackendService(d *schema.ResourceData) (*computeBeta.BackendService, ForceSendFields: []string{"IncludeProtocol", "IncludeHost", "IncludeQueryString", "QueryStringWhitelist", "QueryStringBlacklist"}, }, }, - CustomRequestHeaders: convertStringSet(d.Get("custom_request_headers").(*schema.Set)), } if v, ok := d.GetOk("iap"); ok { diff --git a/google/resource_compute_backend_service_test.go b/google/resource_compute_backend_service_test.go index 19d8116a6ad..3c7fc16e4f7 100644 --- a/google/resource_compute_backend_service_test.go +++ b/google/resource_compute_backend_service_test.go @@ -588,37 +588,6 @@ func TestAccComputeBackendService_withMaxConnectionsPerInstance(t *testing.T) { } } -func TestAccComputeBackendService_withCustomHeaders(t *testing.T) { - t.Parallel() - - serviceName := fmt.Sprintf("tf-test-%s", acctest.RandString(10)) - checkName := fmt.Sprintf("tf-test-%s", acctest.RandString(10)) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckComputeBackendServiceDestroy, - Steps: []resource.TestStep{ - resource.TestStep{ - Config: testAccComputeBackendService_withCustomHeaders(serviceName, checkName), - }, - resource.TestStep{ - ResourceName: "google_compute_backend_service.foobar", - ImportState: true, - ImportStateVerify: true, - }, - resource.TestStep{ - Config: testAccComputeBackendService_basic(serviceName, checkName), - }, - resource.TestStep{ - ResourceName: "google_compute_backend_service.foobar", - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func testAccComputeBackendService_basic(serviceName, checkName string) string { return fmt.Sprintf(` resource "google_compute_backend_service" "foobar" { @@ -1006,21 +975,3 @@ resource "google_compute_health_check" "default" { } `, serviceName, maxConnectionsPerInstance, igName, itName, checkName) } - -func testAccComputeBackendService_withCustomHeaders(serviceName, checkName string) string { - return fmt.Sprintf(` -resource "google_compute_backend_service" "foobar" { - name = "%s" - health_checks = ["${google_compute_http_health_check.zero.self_link}"] - - custom_request_headers = ["Client-Region: {client_region}", "Client-Rtt: {client_rtt_msec}"] -} - -resource "google_compute_http_health_check" "zero" { - name = "%s" - request_path = "/" - check_interval_sec = 1 - timeout_sec = 1 -} -`, serviceName, checkName) -}