@@ -101,6 +101,21 @@ Accepted format is '//certificatemanager.googleapis.com/projects/{project}/locat
101
101
DiffSuppressFunc : tpgresource .CompareSelfLinkOrResourceName ,
102
102
Description : `The Region in which the created target https proxy should reside.
103
103
If it is not provided, the provider region is used.` ,
104
+ },
105
+ "server_tls_policy" : {
106
+ Type : schema .TypeString ,
107
+ Optional : true ,
108
+ ForceNew : true ,
109
+ DiffSuppressFunc : tpgresource .CompareSelfLinkOrResourceName ,
110
+ Description : `A URL referring to a networksecurity.ServerTlsPolicy
111
+ resource that describes how the proxy should authenticate inbound
112
+ traffic. serverTlsPolicy only applies to a global TargetHttpsProxy
113
+ attached to globalForwardingRules with the loadBalancingScheme
114
+ set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED.
115
+ For details which ServerTlsPolicy resources are accepted with
116
+ INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED
117
+ loadBalancingScheme consult ServerTlsPolicy documentation.
118
+ If left blank, communications are not encrypted.` ,
104
119
},
105
120
"ssl_certificates" : {
106
121
Type : schema .TypeList ,
@@ -192,6 +207,12 @@ func resourceComputeRegionTargetHttpsProxyCreate(d *schema.ResourceData, meta in
192
207
} else if v , ok := d .GetOkExists ("url_map" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (urlMapProp )) && (ok || ! reflect .DeepEqual (v , urlMapProp )) {
193
208
obj ["urlMap" ] = urlMapProp
194
209
}
210
+ serverTlsPolicyProp , err := expandComputeRegionTargetHttpsProxyServerTlsPolicy (d .Get ("server_tls_policy" ), d , config )
211
+ if err != nil {
212
+ return err
213
+ } else if v , ok := d .GetOkExists ("server_tls_policy" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (serverTlsPolicyProp )) && (ok || ! reflect .DeepEqual (v , serverTlsPolicyProp )) {
214
+ obj ["serverTlsPolicy" ] = serverTlsPolicyProp
215
+ }
195
216
regionProp , err := expandComputeRegionTargetHttpsProxyRegion (d .Get ("region" ), d , config )
196
217
if err != nil {
197
218
return err
@@ -338,6 +359,9 @@ func resourceComputeRegionTargetHttpsProxyRead(d *schema.ResourceData, meta inte
338
359
if err := d .Set ("url_map" , flattenComputeRegionTargetHttpsProxyUrlMap (res ["urlMap" ], d , config )); err != nil {
339
360
return fmt .Errorf ("Error reading RegionTargetHttpsProxy: %s" , err )
340
361
}
362
+ if err := d .Set ("server_tls_policy" , flattenComputeRegionTargetHttpsProxyServerTlsPolicy (res ["serverTlsPolicy" ], d , config )); err != nil {
363
+ return fmt .Errorf ("Error reading RegionTargetHttpsProxy: %s" , err )
364
+ }
341
365
if err := d .Set ("region" , flattenComputeRegionTargetHttpsProxyRegion (res ["region" ], d , config )); err != nil {
342
366
return fmt .Errorf ("Error reading RegionTargetHttpsProxy: %s" , err )
343
367
}
@@ -608,6 +632,13 @@ func flattenComputeRegionTargetHttpsProxyUrlMap(v interface{}, d *schema.Resourc
608
632
return tpgresource .ConvertSelfLinkToV1 (v .(string ))
609
633
}
610
634
635
+ func flattenComputeRegionTargetHttpsProxyServerTlsPolicy (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
636
+ if v == nil {
637
+ return v
638
+ }
639
+ return tpgresource .ConvertSelfLinkToV1 (v .(string ))
640
+ }
641
+
611
642
func flattenComputeRegionTargetHttpsProxyRegion (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
612
643
if v == nil {
613
644
return v
@@ -680,6 +711,10 @@ func expandComputeRegionTargetHttpsProxyUrlMap(v interface{}, d tpgresource.Terr
680
711
return f .RelativeLink (), nil
681
712
}
682
713
714
+ func expandComputeRegionTargetHttpsProxyServerTlsPolicy (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
715
+ return v , nil
716
+ }
717
+
683
718
func expandComputeRegionTargetHttpsProxyRegion (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
684
719
f , err := tpgresource .ParseGlobalFieldValue ("regions" , v .(string ), "project" , d , config , true )
685
720
if err != nil {
0 commit comments