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

make enableProxyProtocol field updatable in service_attachment #8840

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
1 change: 0 additions & 1 deletion mmv1/products/compute/ServiceAttachment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ properties:
- !ruby/object:Api::Type::Boolean
name: 'enableProxyProtocol'
required: true
immutable: true
description: |
If true, enable the proxy protocol which is for supplying client TCP/IP
address data in TCP connections that traverse proxies on their way to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ func TestAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate(t *test
ImportStateVerifyIgnore: []string{"target_service", "region"},
},
{
Config: testAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate(context),
Config: testAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate(context, true),
},
{
ResourceName: "google_compute_service_attachment.psc_ilb_service_attachment",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"target_service", "region"},
},
{
Config: testAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate(context, false),
},
{
ResourceName: "google_compute_service_attachment.psc_ilb_service_attachment",
Expand All @@ -48,7 +57,7 @@ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
region = "us-west2"
description = "A service attachment configured with Terraform"

enable_proxy_protocol = true
enable_proxy_protocol = false
connection_preference = "ACCEPT_AUTOMATIC"
nat_subnets = [google_compute_subnetwork.psc_ilb_nat.id]
target_service = google_compute_forwarding_rule.psc_ilb_target_service.id
Expand Down Expand Up @@ -124,7 +133,15 @@ resource "google_compute_subnetwork" "psc_ilb_nat" {
`, context)
}

func testAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate(context map[string]interface{}) string {
func testAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate(context map[string]interface{}, preventDestroy bool) string {
context["lifecycle_block"] = ""
if preventDestroy {
context["lifecycle_block"] = `
lifecycle {
prevent_destroy = true
}`
}

return acctest.Nprintf(`
resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
name = "tf-test-my-psc-ilb%{random_suffix}"
Expand All @@ -141,8 +158,8 @@ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
project_id_or_num = "658859330310"
connection_limit = 4
}

reconcile_connections = false
%{lifecycle_block}
}

resource "google_compute_address" "psc_ilb_consumer_address" {
Expand Down