Skip to content

Commit

Permalink
feat: convert virtual circuit resource & datasource to equinix-sdk-go (
Browse files Browse the repository at this point in the history
…#700)

This updates the `metal_virtual_circuit` resource and data source to use
`equinix-sdk-go` instead of `packngo`. As mentioned in #402, the
`packngo` SDK has been deprecated, and moving to `equinix-sdk-go` makes
it possible for these resources to gain new features in the future.

As an added bonus, the affected code has also been moved to
`internal/resources/metal` to align with #106.
  • Loading branch information
displague authored Jun 20, 2024
2 parents 4757ef7 + 50a06ce commit 379e4d6
Show file tree
Hide file tree
Showing 8 changed files with 513 additions and 398 deletions.
6 changes: 3 additions & 3 deletions docs/data-sources/equinix_metal_virtual_circuit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subcategory: "Metal"
# equinix_metal_virtual_circuit (Data Source)

Use this data source to retrieve a virtual circuit resource from
[Equinix Fabric - software-defined interconnections](https://metal.equinix.com/developers/docs/networking/fabric/)
[Equinix Fabric - software-defined interconnections](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/)

See the [Virtual Routing and Forwarding documentation](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vrf/) for product details and API reference material.

Expand Down Expand Up @@ -38,7 +38,7 @@ In addition to all arguments above, the following attributes are exported:
* `port_id` - UUID of the Connection Port where the VC is scoped to.
* `project_id` - ID of project to which the VC belongs.
* `vnid`, `nni_vlan`, `nni_nvid` - VLAN parameters, see the
[documentation for Equinix Fabric](https://metal.equinix.com/developers/docs/networking/fabric/).
[documentation for Equinix Fabric](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/).
* `description` - Description for the Virtual Circuit resource.
* `tags` - Tags for the Virtual Circuit resource.
* `speed` - Speed of the Virtual Circuit resource.
Expand All @@ -51,4 +51,4 @@ In addition to all arguments above, the following attributes are exported:
* For a /30 block, it will have four IP addresses, but the first and last IP addresses are not usable. We will default to the first usable IP address for the metal_ip.
* `metal_ip` - The Metal IP address for the SVI (Switch Virtual Interface) of the VirtualCircuit. Will default to the first usable IP in the subnet.
* `customer_ip` - The Customer IP address which the CSR switch will peer with. Will default to the other usable IP in the subnet.
* `md5` - The password that can be set for the VRF BGP peer
* `md5` - The password that can be set for the VRF BGP peer
6 changes: 3 additions & 3 deletions docs/resources/equinix_metal_virtual_circuit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subcategory: "Metal"
# equinix_metal_virtual_circuit (Resource)

Use this resource to associate VLAN with a Dedicated Port from
[Equinix Fabric - software-defined interconnections](https://metal.equinix.com/developers/docs/networking/fabric/#associating-a-vlan-with-a-dedicated-port).
[Equinix Fabric - software-defined interconnections](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#associating-a-vlan-with-a-dedicated-port).

See the [Virtual Routing and Forwarding documentation](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vrf/) for product details and API reference material.

Expand Down Expand Up @@ -67,8 +67,8 @@ The following arguments are supported:
In addition to all arguments above, the following attributes are exported:

* `status` - Status of the virtal circuit.
* `vnid` - VNID VLAN parameter, see the [documentation for Equinix Fabric](https://metal.equinix.com/developers/docs/networking/fabric/).
* `nni_vnid` - NNI VLAN parameters, see the [documentation for Equinix Fabric](https://metal.equinix.com/developers/docs/networking/fabric/).
* `vnid` - VNID VLAN parameter, see the [documentation for Equinix Fabric](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/).
* `nni_vnid` - NNI VLAN parameters, see the [documentation for Equinix Fabric](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/).

## Import

Expand Down
5 changes: 3 additions & 2 deletions equinix/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/equinix/terraform-provider-equinix/internal/config"
fabric_connection "github.com/equinix/terraform-provider-equinix/internal/resources/fabric/connection"
fabric_network "github.com/equinix/terraform-provider-equinix/internal/resources/fabric/network"
"github.com/equinix/terraform-provider-equinix/internal/resources/metal/virtual_circuit"
"github.com/equinix/terraform-provider-equinix/internal/resources/metal/vrf"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down Expand Up @@ -112,7 +113,7 @@ func Provider() *schema.Provider {
"equinix_metal_port": dataSourceMetalPort(),
"equinix_metal_reserved_ip_block": dataSourceMetalReservedIPBlock(),
"equinix_metal_spot_market_request": dataSourceMetalSpotMarketRequest(),
"equinix_metal_virtual_circuit": dataSourceMetalVirtualCircuit(),
"equinix_metal_virtual_circuit": virtual_circuit.DataSource(),
"equinix_metal_vrf": vrf.DataSource(),
},
ResourcesMap: map[string]*schema.Resource{
Expand All @@ -139,7 +140,7 @@ func Provider() *schema.Provider {
"equinix_metal_reserved_ip_block": resourceMetalReservedIPBlock(),
"equinix_metal_ip_attachment": resourceMetalIPAttachment(),
"equinix_metal_spot_market_request": resourceMetalSpotMarketRequest(),
"equinix_metal_virtual_circuit": resourceMetalVirtualCircuit(),
"equinix_metal_virtual_circuit": virtual_circuit.Resource(),
"equinix_metal_vrf": vrf.Resource(),
"equinix_metal_bgp_session": resourceMetalBGPSession(),
"equinix_metal_port_vlan_attachment": resourceMetalPortVlanAttachment(),
Expand Down
Loading

0 comments on commit 379e4d6

Please sign in to comment.