diff --git a/go.mod b/go.mod index 6844fab0b..d30224597 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/hcl/v2 v2.20.1 github.com/hashicorp/terraform-json v0.22.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241001161528-0651809a6d85 + github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241001174819-fd67620296f1 github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 32eb3f8c4..78a9a02df 100644 --- a/go.sum +++ b/go.sum @@ -190,8 +190,8 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= github.com/hashicorp/terraform-plugin-testing v1.5.1 h1:T4aQh9JAhmWo4+t1A7x+rnxAJHCDIYW9kXyo4sVO92c= github.com/hashicorp/terraform-plugin-testing v1.5.1/go.mod h1:dg8clO6K59rZ8w9EshBmDp1CxTIPu3yA4iaDpX1h5u0= -github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241001161528-0651809a6d85 h1:6STkwQPr/B8SYjVVMmRqoFnI/JbX1OfiZpujJUUYlhs= -github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241001161528-0651809a6d85/go.mod h1:KmhH9vkbqTNYp9g+1yBfb4iK9CCbKNnakASns8SHzXU= +github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241001174819-fd67620296f1 h1:MX4DUav76oHcTBTSFRoDwOo8dmYrlQQ4PCq/Due6Ijc= +github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241001174819-fd67620296f1/go.mod h1:KmhH9vkbqTNYp9g+1yBfb4iK9CCbKNnakASns8SHzXU= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= diff --git a/tfplan2cai/converters/google/resources/services/compute/compute_network.go b/tfplan2cai/converters/google/resources/services/compute/compute_network.go index f1b70ae5c..629a5c6f2 100644 --- a/tfplan2cai/converters/google/resources/services/compute/compute_network.go +++ b/tfplan2cai/converters/google/resources/services/compute/compute_network.go @@ -132,6 +132,27 @@ func expandComputeNetworkRoutingConfig(v interface{}, d tpgresource.TerraformRes transformed["routingMode"] = transformedRoutingMode } + transformedBgpBestPathSelectionMode, err := expandComputeNetworkRoutingConfigBgpBestPathSelectionMode(d.Get("bgp_best_path_selection_mode"), d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedBgpBestPathSelectionMode); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["bgpBestPathSelectionMode"] = transformedBgpBestPathSelectionMode + } + + transformedBgpAlwaysCompareMed, err := expandComputeNetworkRoutingConfigBgpAlwaysCompareMed(d.Get("bgp_always_compare_med"), d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedBgpAlwaysCompareMed); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["bgpAlwaysCompareMed"] = transformedBgpAlwaysCompareMed + } + + transformedBgpInterRegionCost, err := expandComputeNetworkRoutingConfigBgpInterRegionCost(d.Get("bgp_inter_region_cost"), d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedBgpInterRegionCost); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["bgpInterRegionCost"] = transformedBgpInterRegionCost + } + return transformed, nil } @@ -139,6 +160,18 @@ func expandComputeNetworkRoutingConfigRoutingMode(v interface{}, d tpgresource.T return v, nil } +func expandComputeNetworkRoutingConfigBgpBestPathSelectionMode(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { + return v, nil +} + +func expandComputeNetworkRoutingConfigBgpAlwaysCompareMed(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { + return v, nil +} + +func expandComputeNetworkRoutingConfigBgpInterRegionCost(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { + return v, nil +} + func expandComputeNetworkMtu(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { return v, nil }