Skip to content

Commit 0d8b59c

Browse files
Ip address selection policy (#11957) (#2939)
[upstream:4c84dbe59bdde7f2e6a485ac0339ebd0772c9ed0] Signed-off-by: Modular Magician <[email protected]>
1 parent e4f3da9 commit 0d8b59c

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/hashicorp/hcl/v2 v2.20.1
1212
github.com/hashicorp/terraform-json v0.22.1
1313
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
14-
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015180526-12e4d53b0e12
14+
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015190323-afaa01aa741c
1515
github.com/mitchellh/go-homedir v1.1.0 // indirect
1616
github.com/pkg/errors v0.9.1
1717
github.com/stretchr/testify v1.9.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh
190190
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A=
191191
github.com/hashicorp/terraform-plugin-testing v1.5.1 h1:T4aQh9JAhmWo4+t1A7x+rnxAJHCDIYW9kXyo4sVO92c=
192192
github.com/hashicorp/terraform-plugin-testing v1.5.1/go.mod h1:dg8clO6K59rZ8w9EshBmDp1CxTIPu3yA4iaDpX1h5u0=
193-
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015180526-12e4d53b0e12 h1:a7msssskgkOfjEo2MUd3xe/Jk5cb6ohzFod1daV7ylM=
194-
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015180526-12e4d53b0e12/go.mod h1:0LymWybO9dJ38EJdzzbUKO9LaYBgoJsR/gKVAP+8hr8=
193+
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015190323-afaa01aa741c h1:t78ZUvoIEbvHf+KR1RK8KMSGIiTZzQ5+Kon8JVF+7Wc=
194+
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015190323-afaa01aa741c/go.mod h1:0LymWybO9dJ38EJdzzbUKO9LaYBgoJsR/gKVAP+8hr8=
195195
github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI=
196196
github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM=
197197
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=

tfplan2cai/converters/google/resources/services/compute/compute_backend_service.go

+10
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ func GetComputeBackendServiceApiObject(d tpgresource.TerraformResourceData, conf
291291
} else if v, ok := d.GetOkExists("iap"); ok || !reflect.DeepEqual(v, iapProp) {
292292
obj["iap"] = iapProp
293293
}
294+
ipAddressSelectionPolicyProp, err := expandComputeBackendServiceIpAddressSelectionPolicy(d.Get("ip_address_selection_policy"), d, config)
295+
if err != nil {
296+
return nil, err
297+
} else if v, ok := d.GetOkExists("ip_address_selection_policy"); !tpgresource.IsEmptyValue(reflect.ValueOf(ipAddressSelectionPolicyProp)) && (ok || !reflect.DeepEqual(v, ipAddressSelectionPolicyProp)) {
298+
obj["ipAddressSelectionPolicy"] = ipAddressSelectionPolicyProp
299+
}
294300
loadBalancingSchemeProp, err := expandComputeBackendServiceLoadBalancingScheme(d.Get("load_balancing_scheme"), d, config)
295301
if err != nil {
296302
return nil, err
@@ -1175,6 +1181,10 @@ func expandComputeBackendServiceIapOauth2ClientSecretSha256(v interface{}, d tpg
11751181
return v, nil
11761182
}
11771183

1184+
func expandComputeBackendServiceIpAddressSelectionPolicy(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1185+
return v, nil
1186+
}
1187+
11781188
func expandComputeBackendServiceLoadBalancingScheme(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
11791189
return v, nil
11801190
}

tfplan2cai/converters/google/resources/services/compute/compute_region_backend_service.go

+10
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ func GetComputeRegionBackendServiceApiObject(d tpgresource.TerraformResourceData
220220
} else if v, ok := d.GetOkExists("iap"); ok || !reflect.DeepEqual(v, iapProp) {
221221
obj["iap"] = iapProp
222222
}
223+
ipAddressSelectionPolicyProp, err := expandComputeRegionBackendServiceIpAddressSelectionPolicy(d.Get("ip_address_selection_policy"), d, config)
224+
if err != nil {
225+
return nil, err
226+
} else if v, ok := d.GetOkExists("ip_address_selection_policy"); !tpgresource.IsEmptyValue(reflect.ValueOf(ipAddressSelectionPolicyProp)) && (ok || !reflect.DeepEqual(v, ipAddressSelectionPolicyProp)) {
227+
obj["ipAddressSelectionPolicy"] = ipAddressSelectionPolicyProp
228+
}
223229
loadBalancingSchemeProp, err := expandComputeRegionBackendServiceLoadBalancingScheme(d.Get("load_balancing_scheme"), d, config)
224230
if err != nil {
225231
return nil, err
@@ -1095,6 +1101,10 @@ func expandComputeRegionBackendServiceIapOauth2ClientSecretSha256(v interface{},
10951101
return v, nil
10961102
}
10971103

1104+
func expandComputeRegionBackendServiceIpAddressSelectionPolicy(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1105+
return v, nil
1106+
}
1107+
10981108
func expandComputeRegionBackendServiceLoadBalancingScheme(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
10991109
return v, nil
11001110
}

0 commit comments

Comments
 (0)