From a2bde740eb61d5ac5345ed11c91f29fc5311645e Mon Sep 17 00:00:00 2001 From: Maarc-D Date: Tue, 5 Mar 2024 09:25:46 +0100 Subject: [PATCH] fix(types-for-idempotence): related to issue terraform-provider-google#9353 --- mmv1/products/compute/Router.yaml | 2 +- .../services/compute/resource_compute_router_peer.go.erb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mmv1/products/compute/Router.yaml b/mmv1/products/compute/Router.yaml index 7f868b4ed1a0..3dbd2817c116 100644 --- a/mmv1/products/compute/Router.yaml +++ b/mmv1/products/compute/Router.yaml @@ -150,7 +150,7 @@ properties: This enum field has the one valid value: ALL_SUBNETS item_type: Api::Type::String # TODO(#324): enum? send_empty_value: true - - !ruby/object:Api::Type::Array + - !ruby/object:Api::Type::Set name: advertisedIpRanges description: | User-specified list of individual IP ranges to advertise in diff --git a/mmv1/third_party/terraform/services/compute/resource_compute_router_peer.go.erb b/mmv1/third_party/terraform/services/compute/resource_compute_router_peer.go.erb index 76d3e7c5e4bf..47fd9fba4553 100644 --- a/mmv1/third_party/terraform/services/compute/resource_compute_router_peer.go.erb +++ b/mmv1/third_party/terraform/services/compute/resource_compute_router_peer.go.erb @@ -113,7 +113,7 @@ Leave this field blank to advertise no custom groups.`, }, }, "advertised_ip_ranges": { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Description: `User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode @@ -1095,8 +1095,9 @@ func expandNestedComputeRouterBgpPeerAdvertisedGroups(v interface{}, d tpgresour } func expandNestedComputeRouterBgpPeerAdvertisedIpRanges(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { + v = v.(*Schema.Set).List() l := v.([]interface{}) - req := make([]interface{}, 0, len(l)) + req := make(map[string]interface{}, 0, len(l)) for _, raw := range l { if raw == nil { continue