mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-03 01:01:06 +00:00
Remove backend_service.custom_request_headers from the GA provider (#2405)
<!-- This change is generated by MagicModules. --> /cc @rileykarson
This commit is contained in:
parent
9e65ea6903
commit
b00b5ac74b
@ -159,7 +159,7 @@ 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.",
|
||||
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},
|
||||
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user