Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use default template for metal_virtual_circuit #719

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 38 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,41 @@ 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

### Optional

- `customer_ipv6` (String) The Customer IPv6 address which the CSR switch will peer with. Will default to the other usable IP in the IPv6 subnet.
- `metal_ipv6` (String) The Metal IPv6 address for the SVI (Switch Virtual Interface) of the VirtualCircuit. Will default to the first usable IP in the IPv6 subnet.
- `subnet_ipv6` (String) A subnet from one of the IPv6 blocks associated with the VRF that we will help create an IP reservation for. Can only be either a /126 or /127.
* For a /127 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
* For a /126 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.

### 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
73 changes: 40 additions & 33 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,49 @@ resource "equinix_metal_virtual_circuit" "test" {
}
```

## Argument Reference

The following arguments are supported:

* `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

## Attributes Reference

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://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/).
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `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

### Optional

- `connection_id` (String) UUID of Connection where the VC is scoped to. Only used for dedicated connections
- `customer_ip` (String) The Customer IP address which the CSR switch will peer with. Will default to the other usable IP in the subnet.
- `customer_ipv6` (String) The Customer IPv6 address which the CSR switch will peer with. Will default to the other usable IP in the IPv6 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.
- `metal_ipv6` (String) The Metal IPv6 address for the SVI (Switch Virtual Interface) of the VirtualCircuit. Will default to the first usable IP in the IPv6 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.
- `subnet_ipv6` (String) A subnet from one of the IPv6 blocks associated with the VRF that we will help create an IP reservation for. Can only be either a /126 or /127.
* For a /127 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
* For a /126 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
- `virtual_circuit_id` (String) UUID of an existing VC to configure. Used in the case of shared interconnections where the VC has already been created.
- `vlan_id` (String) UUID of the VLAN to associate
- `vrf_id` (String) UUID of the VRF to associate

### Read-Only

- `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}
```
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.

Loading