From 05c6a08bb591938bcae273dce37896616f3e4b95 Mon Sep 17 00:00:00 2001 From: Charles Treatman Date: Mon, 30 Sep 2024 14:26:23 -0500 Subject: [PATCH] force new VRF if metro or project ID changes --- docs/resources/metal_vrf.md | 24 ++++++++++++++---------- internal/resources/metal/vrf/resource.go | 6 ++++-- templates/resources/metal_vrf.md.tmpl | 15 +-------------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/docs/resources/metal_vrf.md b/docs/resources/metal_vrf.md index 92848e959..2927b1610 100644 --- a/docs/resources/metal_vrf.md +++ b/docs/resources/metal_vrf.md @@ -75,20 +75,24 @@ resource "equinix_metal_virtual_circuit" "example" { } ``` -## Argument Reference + +## Schema -The following arguments are supported: +### Required -* `name` - (Required) User-supplied name of the VRF, unique to the project -* `metro` - (Required) Metro ID or Code where the VRF will be deployed. -* `project_id` - (Required) Project ID where the VRF will be deployed. -* `description` - (Optional) Description of the VRF. -* `local_asn` - (Optional) The 4-byte ASN set on the VRF. -* `ip_ranges` - (Optional) All IPv4 and IPv6 Ranges that will be available to BGP Peers. IPv4 addresses must be /8 or smaller with a minimum size of /29. IPv6 must be /56 or smaller with a minimum size of /64. Ranges must not overlap other ranges within the VRF. +- `metro` (String) Metro ID or Code where the VRF will be deployed +- `name` (String) User-supplied name of the VRF, unique to the project +- `project_id` (String) Project ID where the VRF will be deployed -## Attributes Reference +### Optional -No additional attributes are exported. +- `description` (String) Description of the VRF +- `ip_ranges` (Set of String) All IPv4 and IPv6 Ranges that will be available to BGP Peers. IPv4 addresses must be /8 or smaller with a minimum size of /29. IPv6 must be /56 or smaller with a minimum size of /64. Ranges must not overlap other ranges within the VRF. +- `local_asn` (Number) The 4-byte ASN set on the VRF. + +### Read-Only + +- `id` (String) The ID of this resource. ## Import diff --git a/internal/resources/metal/vrf/resource.go b/internal/resources/metal/vrf/resource.go index 1f19bbe5b..812e7d425 100644 --- a/internal/resources/metal/vrf/resource.go +++ b/internal/resources/metal/vrf/resource.go @@ -39,7 +39,8 @@ func Resource() *schema.Resource { "metro": { Type: schema.TypeString, Required: true, - Description: "Metro Code", + Description: "Metro ID or Code where the VRF will be deployed", + ForceNew: true, }, "local_asn": { Type: schema.TypeInt, @@ -56,7 +57,8 @@ func Resource() *schema.Resource { "project_id": { Type: schema.TypeString, Required: true, - Description: "Project ID", + Description: "Project ID where the VRF will be deployed", + ForceNew: true, }, // TODO: created_by, created_at, updated_at, href }, diff --git a/templates/resources/metal_vrf.md.tmpl b/templates/resources/metal_vrf.md.tmpl index 511bb9abf..8dcf60a67 100644 --- a/templates/resources/metal_vrf.md.tmpl +++ b/templates/resources/metal_vrf.md.tmpl @@ -26,20 +26,7 @@ Attach a Virtual Circuit from a Dedicated Metal Connection to the Metal Gateway. {{tffile "examples/resources/equinix_metal_vrf/example_3.tf"}} -## Argument Reference - -The following arguments are supported: - -* `name` - (Required) User-supplied name of the VRF, unique to the project -* `metro` - (Required) Metro ID or Code where the VRF will be deployed. -* `project_id` - (Required) Project ID where the VRF will be deployed. -* `description` - (Optional) Description of the VRF. -* `local_asn` - (Optional) The 4-byte ASN set on the VRF. -* `ip_ranges` - (Optional) All IPv4 and IPv6 Ranges that will be available to BGP Peers. IPv4 addresses must be /8 or smaller with a minimum size of /29. IPv6 must be /56 or smaller with a minimum size of /64. Ranges must not overlap other ranges within the VRF. - -## Attributes Reference - -No additional attributes are exported. +{{ .SchemaMarkdown | trimspace }} ## Import