Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove backend_service.custom_request_headers from the GA provider #2405

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}