From b8d1189cf371044e3dc224d6de6b626ca5fff7cc Mon Sep 17 00:00:00 2001 From: Tim Hogarty Date: Fri, 10 Nov 2023 23:56:35 -0800 Subject: [PATCH] Update gateway reference, acceptance test, and docs for routing_protocols resource --- docs/resources/equinix_fabric_routing_protocols.md | 2 +- equinix/errors.go | 3 --- equinix/fabric_mapping_helper.go | 1 + equinix/resource_fabric_routing_protocols_acc_test.go | 3 +++ 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/resources/equinix_fabric_routing_protocols.md b/docs/resources/equinix_fabric_routing_protocols.md index dc7955299..aa73db2fb 100644 --- a/docs/resources/equinix_fabric_routing_protocols.md +++ b/docs/resources/equinix_fabric_routing_protocols.md @@ -4,7 +4,7 @@ page_title: "equinix_fabric_routing_protocols Resource - terraform-provider-equi subcategory: "Fabric" description: |- Fabric V4 API compatible resource allows creation and management of Equinix Fabric routing protocols - ~> Note Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to equinix_fabric_ resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new issue https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md + ~> Note Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to equinix_fabric_ resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new issue https://github.com/equinix/terraform-provider-equinix/issues/new?assignees=&labels=bug&projects=&template=bug.yml&title=%5BBug%5D%3A+equinix_fabric_routing_protocols --- # equinix_fabric_routing_protocols (Resource) diff --git a/equinix/errors.go b/equinix/errors.go index b20ba5517..c6292c327 100644 --- a/equinix/errors.go +++ b/equinix/errors.go @@ -97,9 +97,6 @@ func setMap(d *schema.ResourceData, m map[string]interface{}) error { if f, ok := v.(setFn); ok { err = f(d, key) } else { - if key == "router" { - err = d.Set("gateway", v) - } err = d.Set(key, v) } diff --git a/equinix/fabric_mapping_helper.go b/equinix/fabric_mapping_helper.go index a27f70fd5..50424c8d7 100644 --- a/equinix/fabric_mapping_helper.go +++ b/equinix/fabric_mapping_helper.go @@ -693,6 +693,7 @@ func accessPointToTerra(accessPoint *v4.AccessPoint) *schema.Set { } if accessPoint.Router != nil { mappedAccessPoint["router"] = CloudRouterToTerra(accessPoint.Router) + mappedAccessPoint["gateway"] = CloudRouterToTerra(accessPoint.Router) } if accessPoint.LinkProtocol != nil { mappedAccessPoint["link_protocol"] = linkedProtocolToTerra(*accessPoint.LinkProtocol) diff --git a/equinix/resource_fabric_routing_protocols_acc_test.go b/equinix/resource_fabric_routing_protocols_acc_test.go index 3671d0fe1..6dad34f42 100644 --- a/equinix/resource_fabric_routing_protocols_acc_test.go +++ b/equinix/resource_fabric_routing_protocols_acc_test.go @@ -24,6 +24,9 @@ func TestAccFabricCreateRoutingProtocols(t *testing.T) { }), ), ExpectNonEmptyPlan: true, + ImportStateId: "//", + ImportState: true, + ImportStateVerify: true, }, }, })