@@ -688,6 +688,12 @@ For internal load balancing, a URL to a HealthCheck resource must be specified i
688
688
},
689
689
},
690
690
},
691
+ "ip_address_selection_policy" : {
692
+ Type : schema .TypeString ,
693
+ Optional : true ,
694
+ ValidateFunc : verify .ValidateEnum ([]string {"IPV4_ONLY" , "PREFER_IPV6" , "IPV6_ONLY" , "" }),
695
+ Description : `Specifies preference of traffic to the backend (from the proxy and from the client for proxyless gRPC). Possible values: ["IPV4_ONLY", "PREFER_IPV6", "IPV6_ONLY"]` ,
696
+ },
691
697
"load_balancing_scheme" : {
692
698
Type : schema .TypeString ,
693
699
Optional : true ,
@@ -1441,6 +1447,12 @@ func resourceComputeBackendServiceCreate(d *schema.ResourceData, meta interface{
1441
1447
} else if v , ok := d .GetOkExists ("iap" ); ok || ! reflect .DeepEqual (v , iapProp ) {
1442
1448
obj ["iap" ] = iapProp
1443
1449
}
1450
+ ipAddressSelectionPolicyProp , err := expandComputeBackendServiceIpAddressSelectionPolicy (d .Get ("ip_address_selection_policy" ), d , config )
1451
+ if err != nil {
1452
+ return err
1453
+ } else if v , ok := d .GetOkExists ("ip_address_selection_policy" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (ipAddressSelectionPolicyProp )) && (ok || ! reflect .DeepEqual (v , ipAddressSelectionPolicyProp )) {
1454
+ obj ["ipAddressSelectionPolicy" ] = ipAddressSelectionPolicyProp
1455
+ }
1444
1456
loadBalancingSchemeProp , err := expandComputeBackendServiceLoadBalancingScheme (d .Get ("load_balancing_scheme" ), d , config )
1445
1457
if err != nil {
1446
1458
return err
@@ -1746,6 +1758,9 @@ func resourceComputeBackendServiceRead(d *schema.ResourceData, meta interface{})
1746
1758
if err := d .Set ("iap" , flattenComputeBackendServiceIap (res ["iap" ], d , config )); err != nil {
1747
1759
return fmt .Errorf ("Error reading BackendService: %s" , err )
1748
1760
}
1761
+ if err := d .Set ("ip_address_selection_policy" , flattenComputeBackendServiceIpAddressSelectionPolicy (res ["ipAddressSelectionPolicy" ], d , config )); err != nil {
1762
+ return fmt .Errorf ("Error reading BackendService: %s" , err )
1763
+ }
1749
1764
if err := d .Set ("load_balancing_scheme" , flattenComputeBackendServiceLoadBalancingScheme (res ["loadBalancingScheme" ], d , config )); err != nil {
1750
1765
return fmt .Errorf ("Error reading BackendService: %s" , err )
1751
1766
}
@@ -1898,6 +1913,12 @@ func resourceComputeBackendServiceUpdate(d *schema.ResourceData, meta interface{
1898
1913
} else if v , ok := d .GetOkExists ("iap" ); ok || ! reflect .DeepEqual (v , iapProp ) {
1899
1914
obj ["iap" ] = iapProp
1900
1915
}
1916
+ ipAddressSelectionPolicyProp , err := expandComputeBackendServiceIpAddressSelectionPolicy (d .Get ("ip_address_selection_policy" ), d , config )
1917
+ if err != nil {
1918
+ return err
1919
+ } else if v , ok := d .GetOkExists ("ip_address_selection_policy" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , ipAddressSelectionPolicyProp )) {
1920
+ obj ["ipAddressSelectionPolicy" ] = ipAddressSelectionPolicyProp
1921
+ }
1901
1922
loadBalancingSchemeProp , err := expandComputeBackendServiceLoadBalancingScheme (d .Get ("load_balancing_scheme" ), d , config )
1902
1923
if err != nil {
1903
1924
return err
@@ -2943,6 +2964,10 @@ func flattenComputeBackendServiceIapOauth2ClientSecretSha256(v interface{}, d *s
2943
2964
return v
2944
2965
}
2945
2966
2967
+ func flattenComputeBackendServiceIpAddressSelectionPolicy (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
2968
+ return v
2969
+ }
2970
+
2946
2971
func flattenComputeBackendServiceLoadBalancingScheme (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
2947
2972
return v
2948
2973
}
@@ -4231,6 +4256,10 @@ func expandComputeBackendServiceIapOauth2ClientSecretSha256(v interface{}, d tpg
4231
4256
return v , nil
4232
4257
}
4233
4258
4259
+ func expandComputeBackendServiceIpAddressSelectionPolicy (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
4260
+ return v , nil
4261
+ }
4262
+
4234
4263
func expandComputeBackendServiceLoadBalancingScheme (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
4235
4264
return v , nil
4236
4265
}
0 commit comments