From 188ce8cb71afee75eb692c1b09d0e4ca03f962c4 Mon Sep 17 00:00:00 2001 From: srushti-patl Date: Mon, 5 Aug 2024 11:10:27 -0700 Subject: [PATCH 1/4] fix: Fixing METAL NIMF docs --- .../metal_connection/shared_nimf_from_fcr.tf | 33 +++++++------------ .../metal_connection/shared_nimf_to_csp.tf | 13 +++----- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/examples/resources/metal_connection/shared_nimf_from_fcr.tf b/examples/resources/metal_connection/shared_nimf_from_fcr.tf index 651e7f184..58f39d832 100644 --- a/examples/resources/metal_connection/shared_nimf_from_fcr.tf +++ b/examples/resources/metal_connection/shared_nimf_from_fcr.tf @@ -6,17 +6,14 @@ resource "equinix_metal_connection" "example" { name = "tf-port-to-metal-legacy" project_id = local.my_project_id metro = "SV" - redundancy = "redundant" - type = "shared" + redundancy = "primary" + type = "shared_port_vlan" contact_email = "username@example.com" - vlans = [ - equinix_metal_vlan.example1.vxlan, - equinix_metal_vlan.example2.vxlan - ] + vlans = [ equinix_metal_vlan.example1.vxlan ] } resource "equinix_fabric_connection" "example" { name = "tf-NIMF-metal-2-aws-legacy" - type = "EVPL_VC" + type = "IP_VC" notifications { type = "ALL" emails = "sername@example.com" @@ -29,23 +26,17 @@ resource "equinix_fabric_connection" "example" { purchase_order_number = "1-323292" } a_side { - access_point { - type = "METAL_NETWORK" - authentication_key = equinix_metal_connection.metal-connection.authorization_code - } + access_point { + type = "CLOUD_ROUTER" + router { + uuid = local.cloud_router_uuid + } + } } z_side { access_point { - type = "SP" - authentication_key = local.aws_account_id - seller_region = "us-west-1" - profile { - type = "L2_PROFILE" - uuid = data.equinix_fabric_service_profiles.zside[0].id - } - location { - metro_code ="SV" - } + type = "METAL_NETWORK" + authentication_key = equinix_metal_connection.example.authorization_code } } } diff --git a/examples/resources/metal_connection/shared_nimf_to_csp.tf b/examples/resources/metal_connection/shared_nimf_to_csp.tf index aa87ea1d8..f4aa7b7b6 100644 --- a/examples/resources/metal_connection/shared_nimf_to_csp.tf +++ b/examples/resources/metal_connection/shared_nimf_to_csp.tf @@ -6,16 +6,13 @@ resource "equinix_metal_connection" "example" { name = "tf-port-to-metal-legacy" project_id = local.my_project_id metro = "SV" - redundancy = "redundant" - type = "shared" + redundancy = "primary" + type = "shared_port_vlan" contact_email = "username@example.com" - vlans = [ - equinix_metal_vlan.example1.vxlan, - equinix_metal_vlan.example2.vxlan - ] + vlans = [ equinix_metal_vlan.example1.vxlan ] } data "equinix_fabric_service_profiles" "zside" { - count = var.zside_ap_type == "SP" ? 1 : 0 + count = local.zside_ap_type == "SP" ? 1 : 0 filter { property = "/name" operator = "=" @@ -39,7 +36,7 @@ resource "equinix_fabric_connection" "example" { a_side { access_point { type = "METAL_NETWORK" - authentication_key = equinix_metal_connection.metal-connection.authorization_code + authentication_key = equinix_metal_connection.example.authorization_code } } z_side { From e63511000fb77c2c3c808961304c79c539186e29 Mon Sep 17 00:00:00 2001 From: srushti-patl Date: Mon, 5 Aug 2024 11:15:27 -0700 Subject: [PATCH 2/4] fix:Updating docs file using make docs command. --- docs/resources/metal_connection.md | 46 +++++++++++------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/docs/resources/metal_connection.md b/docs/resources/metal_connection.md index 421469e91..ca2114932 100644 --- a/docs/resources/metal_connection.md +++ b/docs/resources/metal_connection.md @@ -139,16 +139,13 @@ resource "equinix_metal_connection" "example" { name = "tf-port-to-metal-legacy" project_id = local.my_project_id metro = "SV" - redundancy = "redundant" - type = "shared" + redundancy = "primary" + type = "shared_port_vlan" contact_email = "username@example.com" - vlans = [ - equinix_metal_vlan.example1.vxlan, - equinix_metal_vlan.example2.vxlan - ] + vlans = [ equinix_metal_vlan.example1.vxlan ] } data "equinix_fabric_service_profiles" "zside" { - count = var.zside_ap_type == "SP" ? 1 : 0 + count = local.zside_ap_type == "SP" ? 1 : 0 filter { property = "/name" operator = "=" @@ -172,7 +169,7 @@ resource "equinix_fabric_connection" "example" { a_side { access_point { type = "METAL_NETWORK" - authentication_key = equinix_metal_connection.metal-connection.authorization_code + authentication_key = equinix_metal_connection.example.authorization_code } } z_side { @@ -203,17 +200,14 @@ resource "equinix_metal_connection" "example" { name = "tf-port-to-metal-legacy" project_id = local.my_project_id metro = "SV" - redundancy = "redundant" - type = "shared" + redundancy = "primary" + type = "shared_port_vlan" contact_email = "username@example.com" - vlans = [ - equinix_metal_vlan.example1.vxlan, - equinix_metal_vlan.example2.vxlan - ] + vlans = [ equinix_metal_vlan.example1.vxlan ] } resource "equinix_fabric_connection" "example" { name = "tf-NIMF-metal-2-aws-legacy" - type = "EVPL_VC" + type = "IP_VC" notifications { type = "ALL" emails = "sername@example.com" @@ -226,23 +220,17 @@ resource "equinix_fabric_connection" "example" { purchase_order_number = "1-323292" } a_side { - access_point { - type = "METAL_NETWORK" - authentication_key = equinix_metal_connection.metal-connection.authorization_code - } + access_point { + type = "CLOUD_ROUTER" + router { + uuid = local.cloud_router_uuid + } + } } z_side { access_point { - type = "SP" - authentication_key = local.aws_account_id - seller_region = "us-west-1" - profile { - type = "L2_PROFILE" - uuid = data.equinix_fabric_service_profiles.zside[0].id - } - location { - metro_code ="SV" - } + type = "METAL_NETWORK" + authentication_key = equinix_metal_connection.example.authorization_code } } } From 6d3a7ec65aefd177c32da283c0fd7a232fdbbaed Mon Sep 17 00:00:00 2001 From: srushti-patl Date: Tue, 6 Aug 2024 11:38:24 -0700 Subject: [PATCH 3/4] fix: Updating NIMF definition in doc example --- docs/data-sources/metal_connection.md | 2 +- docs/resources/fabric_connection.md | 8 ++++---- docs/resources/metal_connection.md | 9 ++++----- .../resources/metal_connection/shared_nimf_to_csp.tf | 3 +-- internal/resources/fabric/connection/resource_schema.go | 2 +- templates/data-sources/metal_connection.md.tmpl | 2 +- templates/resources/fabric_connection.md.tmpl | 4 ++-- templates/resources/metal_connection.md.tmpl | 6 +++--- 8 files changed, 17 insertions(+), 19 deletions(-) diff --git a/docs/data-sources/metal_connection.md b/docs/data-sources/metal_connection.md index c2c459a52..3d97f6162 100644 --- a/docs/data-sources/metal_connection.md +++ b/docs/data-sources/metal_connection.md @@ -56,4 +56,4 @@ In addition to all arguments above, the following attributes are exported: * `link_status` - Port link status. * `virtual_circuit_ids` - List of IDs of virtual cicruits attached to this port. * `token` - (Deprecated) Fabric Token required to configure the connection in Equinix Fabric with the [equinix_fabric_connection](../resources/fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). If your organization already has connection service tokens enabled, use `service_tokens` instead. -* `authorization_code` - Fabric Authorization Code to configure the NIMF connection in Equinix Fabric with the [equinix_fabric_connection](../resources/fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). +* `authorization_code` - Fabric Authorization Code to configure the Metal-Fabric Integration connection in Equinix Fabric with the [equinix_fabric_connection](../resources/fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). diff --git a/docs/resources/fabric_connection.md b/docs/resources/fabric_connection.md index 2d6ede05e..2fbdb3bcc 100644 --- a/docs/resources/fabric_connection.md +++ b/docs/resources/fabric_connection.md @@ -663,7 +663,7 @@ resource "equinix_fabric_connection" "evplan" { } ``` -NIMF Metal to AWS EVPL_VC Connection: +(Metal-Fabric Integration) Metal to AWS EVPL_VC Connection: ```terraform resource "equinix_fabric_connection" "metal2aws" { @@ -700,7 +700,7 @@ resource "equinix_fabric_connection" "metal2aws" { } ``` -NIMF Fabric Cloud Router to Metal IP_VC Connection: +(Metal-Fabric Integration) Fabric Cloud Router to Metal IP_VC Connection: ```terraform resource "equinix_fabric_connection" "fcr2metal" { @@ -791,7 +791,7 @@ Optional: Optional: -- `authentication_key` (String) Authentication key for provider based connections or Metal NIMF connections +- `authentication_key` (String) Authentication key for provider based connections or Metal-Fabric Integration connections - `gateway` (Block Set, Max: 1, Deprecated) **Deprecated** `gateway` Use `router` attribute instead (see [below for nested schema](#nestedblock--a_side--access_point--gateway)) - `interface` (Block Set, Max: 1) Virtual device interface (see [below for nested schema](#nestedblock--a_side--access_point--interface)) - `link_protocol` (Block Set, Max: 1) Connection link protocol (see [below for nested schema](#nestedblock--a_side--access_point--link_protocol)) @@ -1008,7 +1008,7 @@ Optional: Optional: -- `authentication_key` (String) Authentication key for provider based connections or Metal NIMF connections +- `authentication_key` (String) Authentication key for provider based connections or Metal-Fabric Integration connections - `gateway` (Block Set, Max: 1, Deprecated) **Deprecated** `gateway` Use `router` attribute instead (see [below for nested schema](#nestedblock--z_side--access_point--gateway)) - `interface` (Block Set, Max: 1) Virtual device interface (see [below for nested schema](#nestedblock--z_side--access_point--interface)) - `link_protocol` (Block Set, Max: 1) Connection link protocol (see [below for nested schema](#nestedblock--z_side--access_point--link_protocol)) diff --git a/docs/resources/metal_connection.md b/docs/resources/metal_connection.md index ca2114932..2ac5f1fc7 100644 --- a/docs/resources/metal_connection.md +++ b/docs/resources/metal_connection.md @@ -128,7 +128,7 @@ resource "equinix_fabric_connection" "example" { } ``` -### Shared Connection with authorization_code Non-redundant NIMF connection from Equinix Metal to a Cloud Service Provider via Equinix Fabric Port +### Shared Connection with authorization_code Non-redundant Metal-Fabric Integration connection from Equinix Metal to a Cloud Service Provider via Equinix Fabric Port ```terraform resource "equinix_metal_vlan" "example1" { @@ -145,7 +145,6 @@ resource "equinix_metal_connection" "example" { vlans = [ equinix_metal_vlan.example1.vxlan ] } data "equinix_fabric_service_profiles" "zside" { - count = local.zside_ap_type == "SP" ? 1 : 0 filter { property = "/name" operator = "=" @@ -179,7 +178,7 @@ resource "equinix_fabric_connection" "example" { seller_region = "us-west-1" profile { type = "L2_PROFILE" - uuid = data.equinix_fabric_service_profiles.zside[0].id + uuid = data.equinix_fabric_service_profiles.zside.id } location { metro_code ="SV" @@ -189,7 +188,7 @@ resource "equinix_fabric_connection" "example" { } ``` -### Shared Connection with authorization_code Non-redundant NIMF connection from Equinix Fabric Cloud Router to Equinix Metal +### Shared Connection with authorization_code Non-redundant Metal-Fabric Integration connection from Equinix Fabric Cloud Router to Equinix Metal ```terraform resource "equinix_metal_vlan" "example1" { @@ -263,4 +262,4 @@ In addition to all arguments above, the following attributes are exported: * `ports` - List of connection ports - primary (`ports[0]`) and secondary (`ports[1]`). Schema of port is described in documentation of the [equinix_metal_connection datasource](../data-sources/metal_connection.md). * `service_tokens` - List of connection service tokens with attributes required to configure the connection in Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). Scehma of service_token is described in documentation of the [equinix_metal_connection datasource](../data-sources/metal_connection.md). * `token` - (Deprecated) Fabric Token required to configure the connection in Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). If your organization already has connection service tokens enabled, use `service_tokens` instead. -* `authorization_code` - Fabric Authorization code to configure the NIMF connection with Cloud Service Provider through Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource from the [Equinix Developer Portal](https://developer.equinix.com/dev-docs/fabric/getting-started/fabric-v4-apis/connect-metal-to-amazon-web-services). +* `authorization_code` - Fabric Authorization code to configure the Metal-Fabric Integration connection with Cloud Service Provider through Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource from the [Equinix Developer Portal](https://developer.equinix.com/dev-docs/fabric/getting-started/fabric-v4-apis/connect-metal-to-amazon-web-services). diff --git a/examples/resources/metal_connection/shared_nimf_to_csp.tf b/examples/resources/metal_connection/shared_nimf_to_csp.tf index f4aa7b7b6..9b26b3d8c 100644 --- a/examples/resources/metal_connection/shared_nimf_to_csp.tf +++ b/examples/resources/metal_connection/shared_nimf_to_csp.tf @@ -12,7 +12,6 @@ resource "equinix_metal_connection" "example" { vlans = [ equinix_metal_vlan.example1.vxlan ] } data "equinix_fabric_service_profiles" "zside" { - count = local.zside_ap_type == "SP" ? 1 : 0 filter { property = "/name" operator = "=" @@ -46,7 +45,7 @@ resource "equinix_fabric_connection" "example" { seller_region = "us-west-1" profile { type = "L2_PROFILE" - uuid = data.equinix_fabric_service_profiles.zside[0].id + uuid = data.equinix_fabric_service_profiles.zside.id } location { metro_code ="SV" diff --git a/internal/resources/fabric/connection/resource_schema.go b/internal/resources/fabric/connection/resource_schema.go index fadbdeddc..f1de3c2c8 100644 --- a/internal/resources/fabric/connection/resource_schema.go +++ b/internal/resources/fabric/connection/resource_schema.go @@ -321,7 +321,7 @@ func accessPointSch() *schema.Resource { "authentication_key": { Type: schema.TypeString, Optional: true, - Description: "Authentication key for provider based connections or Metal NIMF connections", + Description: "Authentication key for provider based connections or Metal-Fabric Integration connections", }, "provider_connection_id": { Type: schema.TypeString, diff --git a/templates/data-sources/metal_connection.md.tmpl b/templates/data-sources/metal_connection.md.tmpl index 35a41611d..bec9895be 100644 --- a/templates/data-sources/metal_connection.md.tmpl +++ b/templates/data-sources/metal_connection.md.tmpl @@ -56,4 +56,4 @@ In addition to all arguments above, the following attributes are exported: * `link_status` - Port link status. * `virtual_circuit_ids` - List of IDs of virtual cicruits attached to this port. * `token` - (Deprecated) Fabric Token required to configure the connection in Equinix Fabric with the [equinix_fabric_connection](../resources/fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). If your organization already has connection service tokens enabled, use `service_tokens` instead. -* `authorization_code` - Fabric Authorization Code to configure the NIMF connection in Equinix Fabric with the [equinix_fabric_connection](../resources/fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). +* `authorization_code` - Fabric Authorization Code to configure the Metal-Fabric Integration connection in Equinix Fabric with the [equinix_fabric_connection](../resources/fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). diff --git a/templates/resources/fabric_connection.md.tmpl b/templates/resources/fabric_connection.md.tmpl index bd0f1014d..9c2a9e641 100644 --- a/templates/resources/fabric_connection.md.tmpl +++ b/templates/resources/fabric_connection.md.tmpl @@ -86,11 +86,11 @@ EVPLAN Port to Network Connection: {{tffile "examples/resources/fabric_connection/port_to_network_evplan.tf"}} -NIMF Metal to AWS EVPL_VC Connection: +(Metal-Fabric Integration) Metal to AWS EVPL_VC Connection: {{tffile "examples/resources/fabric_connection/metal_to_aws.tf"}} -NIMF Fabric Cloud Router to Metal IP_VC Connection: +(Metal-Fabric Integration) Fabric Cloud Router to Metal IP_VC Connection: {{tffile "examples/resources/fabric_connection/fcr_to_metal.tf"}} diff --git a/templates/resources/metal_connection.md.tmpl b/templates/resources/metal_connection.md.tmpl index c4fb9829c..907cb50f7 100644 --- a/templates/resources/metal_connection.md.tmpl +++ b/templates/resources/metal_connection.md.tmpl @@ -30,11 +30,11 @@ Use this resource to request the creation an Interconnection asset to connect wi {{tffile "examples/resources/metal_connection/shared_no_token_metal_to_fabric.tf"}} -### Shared Connection with authorization_code Non-redundant NIMF connection from Equinix Metal to a Cloud Service Provider via Equinix Fabric Port +### Shared Connection with authorization_code Non-redundant Metal-Fabric Integration connection from Equinix Metal to a Cloud Service Provider via Equinix Fabric Port {{tffile "examples/resources/metal_connection/shared_nimf_to_csp.tf"}} -### Shared Connection with authorization_code Non-redundant NIMF connection from Equinix Fabric Cloud Router to Equinix Metal +### Shared Connection with authorization_code Non-redundant Metal-Fabric Integration connection from Equinix Fabric Cloud Router to Equinix Metal {{tffile "examples/resources/metal_connection/shared_nimf_from_fcr.tf"}} @@ -65,4 +65,4 @@ In addition to all arguments above, the following attributes are exported: * `ports` - List of connection ports - primary (`ports[0]`) and secondary (`ports[1]`). Schema of port is described in documentation of the [equinix_metal_connection datasource](../data-sources/metal_connection.md). * `service_tokens` - List of connection service tokens with attributes required to configure the connection in Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). Scehma of service_token is described in documentation of the [equinix_metal_connection datasource](../data-sources/metal_connection.md). * `token` - (Deprecated) Fabric Token required to configure the connection in Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource or from the [Equinix Fabric Portal](https://fabric.equinix.com/dashboard). If your organization already has connection service tokens enabled, use `service_tokens` instead. -* `authorization_code` - Fabric Authorization code to configure the NIMF connection with Cloud Service Provider through Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource from the [Equinix Developer Portal](https://developer.equinix.com/dev-docs/fabric/getting-started/fabric-v4-apis/connect-metal-to-amazon-web-services). +* `authorization_code` - Fabric Authorization code to configure the Metal-Fabric Integration connection with Cloud Service Provider through Equinix Fabric with the [equinix_fabric_connection](./fabric_connection.md) resource from the [Equinix Developer Portal](https://developer.equinix.com/dev-docs/fabric/getting-started/fabric-v4-apis/connect-metal-to-amazon-web-services). From c382d496200291952704601d67073ed3f4fa1568 Mon Sep 17 00:00:00 2001 From: srushti-patl Date: Wed, 7 Aug 2024 11:41:11 -0700 Subject: [PATCH 4/4] fix: Updating NIMF example files names --- ...from_fcr.tf => shared_metal_fabric_connection_from_fcr.tf} | 0 ...imf_to_csp.tf => shared_metal_fabric_connection_to_csp.tf} | 0 templates/resources/metal_connection.md.tmpl | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename examples/resources/metal_connection/{shared_nimf_from_fcr.tf => shared_metal_fabric_connection_from_fcr.tf} (100%) rename examples/resources/metal_connection/{shared_nimf_to_csp.tf => shared_metal_fabric_connection_to_csp.tf} (100%) diff --git a/examples/resources/metal_connection/shared_nimf_from_fcr.tf b/examples/resources/metal_connection/shared_metal_fabric_connection_from_fcr.tf similarity index 100% rename from examples/resources/metal_connection/shared_nimf_from_fcr.tf rename to examples/resources/metal_connection/shared_metal_fabric_connection_from_fcr.tf diff --git a/examples/resources/metal_connection/shared_nimf_to_csp.tf b/examples/resources/metal_connection/shared_metal_fabric_connection_to_csp.tf similarity index 100% rename from examples/resources/metal_connection/shared_nimf_to_csp.tf rename to examples/resources/metal_connection/shared_metal_fabric_connection_to_csp.tf diff --git a/templates/resources/metal_connection.md.tmpl b/templates/resources/metal_connection.md.tmpl index 907cb50f7..c257a4a72 100644 --- a/templates/resources/metal_connection.md.tmpl +++ b/templates/resources/metal_connection.md.tmpl @@ -32,11 +32,11 @@ Use this resource to request the creation an Interconnection asset to connect wi ### Shared Connection with authorization_code Non-redundant Metal-Fabric Integration connection from Equinix Metal to a Cloud Service Provider via Equinix Fabric Port -{{tffile "examples/resources/metal_connection/shared_nimf_to_csp.tf"}} +{{tffile "examples/resources/metal_connection/shared_metal_fabric_connection_to_csp.tf"}} ### Shared Connection with authorization_code Non-redundant Metal-Fabric Integration connection from Equinix Fabric Cloud Router to Equinix Metal -{{tffile "examples/resources/metal_connection/shared_nimf_from_fcr.tf"}} +{{tffile "examples/resources/metal_connection/shared_metal_fabric_connection_from_fcr.tf"}} ## Argument Reference