Skip to content

Commit

Permalink
Remove backend_service.custom_request_headers from the GA provider (#…
Browse files Browse the repository at this point in the history
…2405)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and nat-henderson committed Dec 21, 2018
1 parent 9e65ea6 commit b00b5ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 56 deletions.
13 changes: 6 additions & 7 deletions google/resource_compute_backend_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down
49 changes: 0 additions & 49 deletions google/resource_compute_backend_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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)
}

0 comments on commit b00b5ac

Please sign in to comment.