Skip to content

Commit

Permalink
docs: use default template for metal_virtual_circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreatma committed Jul 2, 2024
1 parent f5723b6 commit f8f0719
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 157 deletions.
57 changes: 30 additions & 27 deletions docs/data-sources/metal_virtual_circuit.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,33 @@ data "equinix_metal_virtual_circuit" "example_vc" {
}
```

## Argument Reference

The following arguments are supported:

* `virtual_circuit_id` - (Required) ID of the virtual circuit resource

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `name` - Name of the virtual circuit resource.
* `connection_id` - UUID of Connection where the VC is scoped to.
* `status` - Status of the virtal circuit.
* `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://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.
* `vrf_id` - UUID of the VLAN to associate.
* `peer_asn` - The BGP ASN of the peer. The same ASN may be the used across several VCs, but it cannot be the same as the local_asn of the VRF.
* `subnet` - A subnet from one of the IP blocks associated with the VRF that we will help create an IP reservation for. Can only be either a /30 or /31.
* For a /31 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
* 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
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `virtual_circuit_id` (String) ID of the virtual circuit to lookup

### Read-Only

- `connection_id` (String) UUID of Connection where the VC is scoped to
- `customer_ip` (String) The Customer IP address which the CSR switch will peer with. Will default to the other usable IP in the subnet.
- `description` (String) Description of the virtual circuit
- `id` (String) The ID of this resource.
- `md5` (String, Sensitive) The password that can be set for the VRF BGP peer
- `metal_ip` (String) The Metal IP address for the SVI (Switch Virtual Interface) of the VirtualCircuit. Will default to the first usable IP in the subnet.
- `name` (String) Name of the virtual circuit
- `nni_vlan` (Number) Nni VLAN parameter, see https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/
- `nni_vnid` (Number) Nni VLAN ID parameter, see https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/
- `peer_asn` (Number) The BGP ASN of the peer. The same ASN may be the used across several VCs, but it cannot be the same as the local_asn of the VRF.
- `port_id` (String) UUID of the Connection Port where the VC is scoped to
- `project_id` (String) ID of the projct to which the virtual circuit belongs
- `speed` (String) Description of the Virtual Circuit speed. This is for information purposes and is computed when the connection type is shared.
- `status` (String) Status of the virtual circuit
- `subnet` (String) A subnet from one of the IP blocks associated with the VRF that we will help create an IP reservation for. Can only be either a /30 or /31.
* For a /31 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
* 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.
- `tags` (List of String) Tags attached to the virtual circuit
- `vlan_id` (String) UUID of the associated VLAN
- `vnid` (Number) VNID VLAN parameter, see https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/
- `vrf_id` (String) UUID of the associated VRF
57 changes: 29 additions & 28 deletions docs/resources/metal_virtual_circuit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ See the [Virtual Routing and Forwarding documentation](https://deploy.equinix.co

## Example Usage

Pick an existing Project and dedicated Connection, create a VLAN and use `equinix_metal_virtual_circuit` to associate it with a Primary Port of the Connection.

```terraform
locals {
project_id = "52000fb2-ee46-4673-93a8-de2c2bdba33c"
Expand All @@ -36,40 +34,43 @@ resource "equinix_metal_virtual_circuit" "test" {
}
```

## Argument Reference
<!-- schema generated by tfplugindocs -->
## Schema

### Required

The following arguments are supported:
- `connection_id` (String) UUID of Connection where the VC is scoped to
- `port_id` (String) UUID of the Connection Port where the VC is scoped to
- `project_id` (String) UUID of the Project where the VC is scoped to

* `connection_id` - (Required) UUID of Connection where the VC is scoped to.
* `project_id` - (Required) UUID of the Project where the VC is scoped to.
* `port_id` - (Required) UUID of the Connection Port where the VC is scoped to.
* `nni_vlan` - (Required) Equinix Metal network-to-network VLAN ID.
* `vlan_id` - (Required) UUID of the VLAN to associate.
* `name` - (Optional) Name of the Virtual Circuit resource.
* `description` - (Optional) Description for the Virtual Circuit resource.
* `tags` - (Optional) Tags for the Virtual Circuit resource.
* `speed` - (Optional) Speed of the Virtual Circuit resource.
* `vrf_id` - (Optional) UUID of the VRF to associate.
* `peer_asn` - (Optional, required with `vrf_id`) The BGP ASN of the peer. The same ASN may be the used across several VCs, but it cannot be the same as the local_asn of the VRF.
* `subnet` - (Optional, required with `vrf_id`) A subnet from one of the IP blocks associated with the VRF that we will help create an IP reservation for. Can only be either a /30 or /31.
* For a /31 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
* 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` - (Optional, required with `vrf_id`) 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` - (Optional, required with `vrf_id`) The Customer IP address which the CSR switch will peer with. Will default to the other usable IP in the subnet.
* `md5` - (Optional, only valid with `vrf_id`) The password that can be set for the VRF BGP peer
### Optional

## Attributes Reference
- `customer_ip` (String) The Customer IP address which the CSR switch will peer with. Will default to the other usable IP in the subnet.
- `description` (String) Description of the Virtual Circuit resource
- `md5` (String, Sensitive) The password that can be set for the VRF BGP peer
- `metal_ip` (String) The Metal IP address for the SVI (Switch Virtual Interface) of the VirtualCircuit. Will default to the first usable IP in the subnet.
- `name` (String) Name of the Virtual Circuit resource
- `nni_vlan` (Number) Equinix Metal network-to-network VLAN ID (optional when the connection has mode=tunnel)
- `peer_asn` (Number) The BGP ASN of the peer. The same ASN may be the used across several VCs, but it cannot be the same as the local_asn of the VRF.
- `speed` (String) Description of the Virtual Circuit speed. This is for information purposes and is computed when the connection type is shared.
- `subnet` (String) A subnet from one of the IP blocks associated with the VRF that we will help create an IP reservation for. Can only be either a /30 or /31.
* For a /31 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
* 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.
- `tags` (List of String) Tags attached to the virtual circuit
- `vlan_id` (String) UUID of the VLAN to associate
- `vrf_id` (String) UUID of the VRF to associate

In addition to all arguments above, the following attributes are exported:
### Read-Only

* `status` - Status of the virtal circuit.
* `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/).
- `id` (String) The ID of this resource.
- `nni_vnid` (Number) Nni VLAN ID parameter, see https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/
- `status` (String) Status of the virtual circuit resource
- `vnid` (Number) VNID VLAN parameter, see https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/

## Import

This resource can be imported using an existing Virtual Circuit ID:
Import is supported using the following syntax:

```sh
```shell
terraform import equinix_metal_virtual_circuit {existing_id}
```
1 change: 1 addition & 0 deletions examples/resources/equinix_metal_virtual_circuit/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import equinix_metal_virtual_circuit {existing_id}
4 changes: 4 additions & 0 deletions internal/resources/metal/virtual_circuit/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (

func DataSource() *schema.Resource {
return &schema.Resource{
Description: `Use this data source to retrieve a virtual circuit resource from [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.
`,
ReadContext: dataSourceMetalVirtualCircuitRead,

Schema: map[string]*schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions internal/resources/metal/virtual_circuit/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import (

func Resource() *schema.Resource {
return &schema.Resource{
Description: `Use this resource to associate VLAN with a Dedicated Port from [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.`,
ReadWithoutTimeout: resourceMetalVirtualCircuitRead,
CreateContext: resourceMetalVirtualCircuitCreate,
UpdateWithoutTimeout: resourceMetalVirtualCircuitUpdate,
Expand Down
45 changes: 0 additions & 45 deletions templates/data-sources/metal_virtual_circuit.md.tmpl

This file was deleted.

57 changes: 0 additions & 57 deletions templates/resources/metal_virtual_circuit.md.tmpl

This file was deleted.

0 comments on commit f8f0719

Please sign in to comment.