Skip to content

Commit 73b85fb

Browse files
gservatrainshen49
authored andcommitted
Add update support to serverTlsPolicy field in region_target_https_proxy (GoogleCloudPlatform#11184)
1 parent a091df0 commit 73b85fb

File tree

3 files changed

+383
-3
lines changed

3 files changed

+383
-3
lines changed

mmv1/products/compute/RegionTargetHttpsProxy.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,13 @@ properties:
204204
INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED
205205
loadBalancingScheme consult ServerTlsPolicy documentation.
206206
If left blank, communications are not encrypted.
207+
208+
If you remove this field from your configuration at the same time as
209+
deleting or recreating a referenced ServerTlsPolicy resource, you will
210+
receive a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy
211+
within the ServerTlsPolicy resource to avoid this.
212+
update_id: 'serverTlsPolicy'
213+
fingerprint_name: 'fingerprint'
214+
update_verb: :PATCH
215+
update_url:
216+
'projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}}'

mmv1/templates/terraform/encoders/compute_region_target_https_proxy.go.erb

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@ if _, ok := obj["certificateManagerCertificates"]; ok {
77
obj["sslCertificates"] = obj["certificateManagerCertificates"]
88
delete(obj, "certificateManagerCertificates")
99
}
10-
return obj, nil
10+
11+
// Send null if serverTlsPolicy is not set. Without this, Terraform would not send any value for `serverTlsPolicy`
12+
// in the "PATCH" payload so if you were to remove a server TLS policy from a target HTTPS proxy, it would NOT remove
13+
// the association.
14+
if _, ok := obj["serverTlsPolicy"]; !ok {
15+
obj["serverTlsPolicy"] = nil
16+
}
17+
18+
return obj, nil

0 commit comments

Comments
 (0)