From 9ffc08d68a1a15035d3d0ec37dc426a34eaa9fe4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:30:14 -0800 Subject: [PATCH] generate-terraform-docs: automated action (#161) Signed-off-by: GitHub Co-authored-by: srushti-patl --- .../README.md | 365 ++++++++++++++++++ .../service-token-for-aside-port/README.md | 227 +++++++++++ .../service-token-for-zside-network/README.md | 208 ++++++++++ .../service-token-for-zside-port/README.md | 232 +++++++++++ .../README.md | 12 +- 5 files changed, 1035 insertions(+), 9 deletions(-) diff --git a/examples/port-2-alibaba-connection-with-alicloud-terraform-integration/README.md b/examples/port-2-alibaba-connection-with-alicloud-terraform-integration/README.md index 3248491..daa84a7 100644 --- a/examples/port-2-alibaba-connection-with-alicloud-terraform-integration/README.md +++ b/examples/port-2-alibaba-connection-with-alicloud-terraform-integration/README.md @@ -48,5 +48,370 @@ See example usage below for details on how to use this example. * This action will automatically delete the connection on the Equinix side, updating its status to Deprovisioned on both Equinix and Provider side +## Equinix Fabric Developer Documentation +To see the documentation for the APIs that the Fabric Terraform Provider is built on +and to learn how to procure your own Client_Id and Client_Secret follow the link below: +[Equinix Fabric Developer Portal](https://developer.equinix.com/docs?page=/dev-docs/fabric/overview) + +## Usage of Example as Terraform Module + +To provision this example directly as a usable module please use the *Provision Instructions* provided by Hashicorp +in the upper right of this page and be sure to include at a minimum the required variables. + +## Usage of Example Locally or in Your Own Configuration + +*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources. + +To provision this example directly, +you should clone the github repository for this module and run terraform within this directory: + +```bash +git clone https://github.com/equinix/terraform-equinix-fabric.git +cd terraform-equinix-fabric/examples/port-2-alibaba-connection-with-alicloud-terraform-integration +terraform init +terraform apply +``` + +To use this example of the module in your own terraform configuration include the following: + +*NOTE: terraform.tfvars must be a separate file, but all other content can be placed together in main.tf if you prefer* + +terraform.tfvars (Replace these values with your own): +```hcl +equinix_client_id = "MyEquinixClientId" +equinix_client_secret = "MyEquinixSecret" + +connection_name = "Port_2_alibaba" +connection_type = "EVPL_VC" +notifications_type = "ALL" +notifications_emails = ["example@equinix.com"] +bandwidth = 50 +purchase_order_number = "1-323292" +aside_port_name = "sit-tb1-dc-e5.tlab,10GSMF,A,001,201257, 21951980" +aside_vlan_tag = 2019 +zside_ap_type = "SP" +zside_ap_authentication_key = "" +zside_ap_profile_type = "L2_PROFILE" +zside_location = "SY" +zside_sp_name = "Alibaba Cloud Express Connect" +zside_seller_region = "ap-southeast-2" +zside_ap_profile_type = "L2_PROFILE" +zside_ap_type = "SP" +zside_location = "SV" +zside_seller_region = "us-west-1" +zside_sp_name = "Alibaba Cloud Express Connect" +region = "us-west-1" +local_gateway_ip = "10.0.0.1" +peer_gateway_ip = "10.0.0.2" +peering_subnet_mask = "255.255.255.252" +virtual_border_router_name = "Port_2_Alibaba_VBR" +min_rx_interval = 1000 +min_tx_interval = 1000 +detect_multiplier = 10 +access_key = "" +secret_key = "" +project_id = "" +``` + +versions.tf +```hcl +terraform { + required_version = ">= 1.5.4" + required_providers { + equinix = { + source = "equinix/equinix" + version = ">= 2.9.0" + } + } +} +``` + +variables.tf + ```hcl +variable "equinix_client_id" { + description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" + type = string + sensitive = true +} +variable "equinix_client_secret" { + description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" + type = string + sensitive = true +} +variable "connection_name" { + description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores" + type = string +} +variable "project_id" { + description = "Subscriber-assigned project ID" + type = string + default = "" +} +variable "connection_type" { + description = "Defines the connection type like VG_VC, EVPL_VC, EPL_VC, EC_VC, IP_VC, ACCESS_EPL_VC" + type = string +} +variable "notifications_type" { + description = "Notification Type - ALL is the only type currently supported" + type = string + default = "ALL" +} +variable "notifications_emails" { + description = "Array of contact emails" + type = list(string) +} +variable "bandwidth" { + description = "Connection bandwidth in Mbps" + type = number +} +variable "purchase_order_number" { + description = "Purchase order number" + type = string + default = "" +} +variable "aside_port_name" { + description = "Equinix A-Side Port Name" + type = string +} +variable "aside_vlan_tag" { + description = "Vlan Tag information, outer vlanSTag for QINQ connections" + type = string +} +variable "aside_vlan_inner_tag" { + description = "Vlan Inner Tag information, inner vlanCTag for QINQ connections" + type = string + default = "" +} +variable "zside_ap_type" { + description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW" + type = string +} +variable "zside_ap_authentication_key" { + description = "Authentication key for provider based connections" + type = string + sensitive = true +} +variable "zside_ap_profile_type" { + description = "Service profile type - L2_PROFILE, L3_PROFILE, ECIA_PROFILE, ECMC_PROFILE" + type = string +} +variable "zside_location" { + description = "Access point metro code" + type = string +} +variable "zside_sp_name" { + description = "Equinix Service Profile Name" + type = string +} +variable "zside_seller_region" { + description = "Access point seller region" + type = string +} +variable "region" { + description = "Region" + type = string +} +variable "access_point_id" { + description = "Access Point ID" + type = string + default = "" +} +variable "local_gateway_ip" { + description = "Local Gateway IP" + type = string + default = "" +} +variable "peer_gateway_ip" { + description = "Peer Gateway IP" + type = string + default = "" +} +variable "peering_subnet_mask" { + description = "Peering Subnet Mask" + type = string + default = "" +} +variable "min_rx_interval" { + description = "Minimum RX Interval" + type = string + default = "" +} +variable "min_tx_interval" { + description = "Minimum TX Interval" + type = string + default = "" +} +variable "detect_multiplier" { + description = "Detect Multiplier" + type = string + default = "" +} +variable "virtual_border_router_name" { + description = "Virtual Border Router Name" + type = string + default = "" +} +variable "access_key" { + description = "Access Key" + type = string + sensitive = true +} +variable "secret_key" { + description = "Secret Key" + type = string + sensitive = true +} +``` + +outputs.tf +```hcl +output "alibaba_connection" { + value = module.create_port_2_alibaba_connection.primary_connection + sensitive = true +} + +output "alibaba_connection_id" { + value = module.create_port_2_alibaba_connection.primary_connection_id +} + +# output "alicloud_express_connect_virtual_border_router" { +# value = alicloud_express_connect_virtual_border_router.vbr +# sensitive = true +# } +# +# output "alicloud_express_connect_virtual_border_router_id" { +# value = alicloud_express_connect_virtual_border_router.vbr.id +# } +# +# output "express_connect_virtual_border_router_id" { +# value = data.alicloud_express_connect_virtual_border_routers.nameRegexVbr.routers.0.id +# } +``` + +main.tf +```hcl +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret +} + +module "create_port_2_alibaba_connection" { + source = "equinix/fabric/equinix//modules/port-connection" + + connection_name = var.connection_name + connection_type = var.connection_type + notifications_type = var.notifications_type + notifications_emails = var.notifications_emails + bandwidth = var.bandwidth + purchase_order_number = var.purchase_order_number + project_id = var.project_id + + # A-side + aside_port_name = var.aside_port_name + aside_vlan_tag = var.aside_vlan_tag + + # Z-side + zside_ap_type = var.zside_ap_type + zside_ap_authentication_key = var.zside_ap_authentication_key + zside_ap_profile_type = var.zside_ap_profile_type + zside_location = var.zside_location + zside_seller_region = var.zside_seller_region + zside_sp_name = var.zside_sp_name +} + +# provider "alicloud" { +# access_key = var.access_key +# secret_key = var.secret_key +# region = var.region +# } +# +# data "alicloud_express_connect_physical_connections" "nameRegex" { +# name_regex = "^${module.create_port_2_alibaba_connection.primary_connection.name}" +# } +# +# resource "alicloud_express_connect_virtual_border_router" "vbr" { +# local_gateway_ip = var.local_gateway_ip +# peer_gateway_ip = var.peer_gateway_ip +# peering_subnet_mask = var.peering_subnet_mask +# physical_connection_id = data.alicloud_express_connect_physical_connections.nameRegex.connections[0].id +# virtual_border_router_name = var.virtual_border_router_name +# vlan_id = one(one(one(module.create_port_2_alibaba_connection.primary_connection.z_side).access_point).link_protocol).vlan_tag +# min_rx_interval = var.min_rx_interval +# min_tx_interval = var.min_tx_interval +# detect_multiplier = var.detect_multiplier +# } +# +# resource "null_resource" "destroy_warning" { +# triggers = { +# warning = "WARNING: Destroy process is not complete yet. You need to delete the resource from Alibaba Portal!" +# } +# } +# +# data "alicloud_express_connect_virtual_border_routers" "nameRegexVbr" { +# name_regex = "^${alicloud_express_connect_virtual_border_router.vbr.virtual_border_router_name}" +# } +``` + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.5.4 | +| [equinix](#requirement\_equinix) | >= 2.9.0 | + +## Providers + +No providers. + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [create\_port\_2\_alibaba\_connection](#module\_create\_port\_2\_alibaba\_connection) | equinix/fabric/equinix//modules/port-connection | n/a | + +## Resources + +No resources. + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [access\_key](#input\_access\_key) | Access Key | `string` | n/a | yes | +| [access\_point\_id](#input\_access\_point\_id) | Access Point ID | `string` | `""` | no | +| [aside\_port\_name](#input\_aside\_port\_name) | Equinix A-Side Port Name | `string` | n/a | yes | +| [aside\_vlan\_inner\_tag](#input\_aside\_vlan\_inner\_tag) | Vlan Inner Tag information, inner vlanCTag for QINQ connections | `string` | `""` | no | +| [aside\_vlan\_tag](#input\_aside\_vlan\_tag) | Vlan Tag information, outer vlanSTag for QINQ connections | `string` | n/a | yes | +| [bandwidth](#input\_bandwidth) | Connection bandwidth in Mbps | `number` | n/a | yes | +| [connection\_name](#input\_connection\_name) | Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores | `string` | n/a | yes | +| [connection\_type](#input\_connection\_type) | Defines the connection type like VG\_VC, EVPL\_VC, EPL\_VC, EC\_VC, IP\_VC, ACCESS\_EPL\_VC | `string` | n/a | yes | +| [detect\_multiplier](#input\_detect\_multiplier) | Detect Multiplier | `string` | `""` | no | +| [equinix\_client\_id](#input\_equinix\_client\_id) | Equinix client ID (consumer key), obtained after registering app in the developer platform | `string` | n/a | yes | +| [equinix\_client\_secret](#input\_equinix\_client\_secret) | Equinix client secret ID (consumer secret), obtained after registering app in the developer platform | `string` | n/a | yes | +| [local\_gateway\_ip](#input\_local\_gateway\_ip) | Local Gateway IP | `string` | `""` | no | +| [min\_rx\_interval](#input\_min\_rx\_interval) | Minimum RX Interval | `string` | `""` | no | +| [min\_tx\_interval](#input\_min\_tx\_interval) | Minimum TX Interval | `string` | `""` | no | +| [notifications\_emails](#input\_notifications\_emails) | Array of contact emails | `list(string)` | n/a | yes | +| [notifications\_type](#input\_notifications\_type) | Notification Type - ALL is the only type currently supported | `string` | `"ALL"` | no | +| [peer\_gateway\_ip](#input\_peer\_gateway\_ip) | Peer Gateway IP | `string` | `""` | no | +| [peering\_subnet\_mask](#input\_peering\_subnet\_mask) | Peering Subnet Mask | `string` | `""` | no | +| [project\_id](#input\_project\_id) | Subscriber-assigned project ID | `string` | `""` | no | +| [purchase\_order\_number](#input\_purchase\_order\_number) | Purchase order number | `string` | `""` | no | +| [region](#input\_region) | Region | `string` | n/a | yes | +| [secret\_key](#input\_secret\_key) | Secret Key | `string` | n/a | yes | +| [virtual\_border\_router\_name](#input\_virtual\_border\_router\_name) | Virtual Border Router Name | `string` | `""` | no | +| [zside\_ap\_authentication\_key](#input\_zside\_ap\_authentication\_key) | Authentication key for provider based connections | `string` | n/a | yes | +| [zside\_ap\_profile\_type](#input\_zside\_ap\_profile\_type) | Service profile type - L2\_PROFILE, L3\_PROFILE, ECIA\_PROFILE, ECMC\_PROFILE | `string` | n/a | yes | +| [zside\_ap\_type](#input\_zside\_ap\_type) | Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW | `string` | n/a | yes | +| [zside\_location](#input\_zside\_location) | Access point metro code | `string` | n/a | yes | +| [zside\_seller\_region](#input\_zside\_seller\_region) | Access point seller region | `string` | n/a | yes | +| [zside\_sp\_name](#input\_zside\_sp\_name) | Equinix Service Profile Name | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [alibaba\_connection](#output\_alibaba\_connection) | n/a | +| [alibaba\_connection\_id](#output\_alibaba\_connection\_id) | n/a | diff --git a/examples/service-token-for-aside-port/README.md b/examples/service-token-for-aside-port/README.md index 55ed077..28879d1 100644 --- a/examples/service-token-for-aside-port/README.md +++ b/examples/service-token-for-aside-port/README.md @@ -8,4 +8,231 @@ you see used in this example it will allow you to create a more specific use cas See example usage below for details on how to use this example. +## Equinix Fabric Developer Documentation + +To see the documentation for the APIs that the Fabric Terraform Provider is built on +and to learn how to procure your own Client_Id and Client_Secret follow the link below: +[Equinix Fabric Developer Portal](https://developer.equinix.com/docs?page=/dev-docs/fabric/overview) + +## Usage of Example as Terraform Module + +To provision this example directly as a usable module please use the *Provision Instructions* provided by Hashicorp +in the upper right of this page and be sure to include at a minimum the required variables. + +## Usage of Example Locally or in Your Own Configuration + +*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources. + +To provision this example directly, +you should clone the github repository for this module and run terraform within this directory: + +```bash +git clone https://github.com/equinix/terraform-equinix-fabric.git +cd terraform-equinix-fabric/examples/service-token-for-aside-port +terraform init +terraform apply +``` + +To use this example of the module in your own terraform configuration include the following: + +*NOTE: terraform.tfvars must be a separate file, but all other content can be placed together in main.tf if you prefer* + +terraform.tfvars (Replace these values with your own): +```hcl +equinix_client_id = "" +equinix_client_secret = "" + +#Service Token +service_token_type = "VC_TOKEN" +service_token_name = "Terra_Test_Token" +service_token_description = "Zside VD Token Test" +service_token_expiration_date_time = "2024-12-29T06:43:49.980Z" +notifications_type = "ALL" +notifications_emails = ["example@equinix.com"] +connection_type = "EVPL_VC" +bandwidth_limit = 1000 +aside_ap_type = "COLO" +aside_port_name = "" +aside_vlan_tag_type = "DOT1Q" +aside_vlan_tag = "2876" +``` + +versions.tf +```hcl +terraform { + required_version = ">= 1.5.4" + required_providers { + equinix = { + source="equinix/equinix" + version = ">= 3.1.0" + } + } +} +``` + +variables.tf + ```hcl +variable "equinix_client_id" { + description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" + type = string + sensitive = true +} +variable "equinix_client_secret" { + description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" + type = string + sensitive = true +} + +#Service Token +variable "service_token_name" { + description = "Service Token Name" + type = string +} +variable "service_token_type" { + description = "Service Token Type; VC_TOKEN,EPL_TOKEN" + type = string +} +variable "service_token_description" { + description = "Service Token Description" + type = string +} +variable "service_token_expiration_date_time" { + description = "Expiration date and time of the service token; 2020-11-06T07:00:00" + type = string +} +variable "notifications_type" { + description = "Notification Type - ALL is the only type currently supported" + type = string +} +variable "notifications_emails" { + description = "Array of contact emails" + type = list(string) +} +variable "connection_type" { + description = "Type of Connection supported by Service Token you will create; EVPL_VC, EVPLAN_VC, EPLAN_VC, IPWAN_VC" + type = string +} +variable "bandwidth_limit" { + description = "Connection bandwidth limit in Mbps" + type = number +} +variable "aside_ap_type" { + description = "Type of Access point; COLO, VD, NETWORK" + type = string +} +variable "aside_port_name" { + description = "Virtual Device UUID" + type = string +} +variable "aside_vlan_tag_type" { + description = "Vlan Tag Type; DOT1Q or QINQ" + type = string +} +variable "aside_vlan_tag" { + description = "Vlan Tag information, outer vlanSTag for QINQ connections" + type = string +} + +``` + +outputs.tf +```hcl +output "service_token_id" { + value = equinix_fabric_service_token.service-token.id +} +output "service-token" { + value = equinix_fabric_service_token.service-token +} +``` + +main.tf +```hcl +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret +} +data "equinix_fabric_ports" "aside_port" { + filters { + name = var.aside_port_name + } +} + +resource "equinix_fabric_service_token" "service-token" { + type = var.service_token_type + name = var.service_token_name + description = var.service_token_description + expiration_date_time = var.service_token_expiration_date_time + notifications { + type = var.notifications_type + emails = var.notifications_emails + } + + service_token_connection { + type = var.connection_type + bandwidth_limit = var.bandwidth_limit + a_side { + access_point_selectors { + type = var.aside_ap_type + port { + uuid = data.equinix_fabric_ports.aside_port.data.0.uuid + } + link_protocol { + type = var.aside_vlan_tag_type + vlan_tag = var.aside_vlan_tag + } + } + } + } +} +``` + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.5.4 | +| [equinix](#requirement\_equinix) | >= 3.1.0 | + +## Providers + +| Name | Version | +|------|---------| +| [equinix](#provider\_equinix) | >= 3.1.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [equinix_fabric_service_token.service-token](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/fabric_service_token) | resource | +| [equinix_fabric_ports.aside_port](https://registry.terraform.io/providers/equinix/equinix/latest/docs/data-sources/fabric_ports) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [aside\_ap\_type](#input\_aside\_ap\_type) | Type of Access point; COLO, VD, NETWORK | `string` | n/a | yes | +| [aside\_port\_name](#input\_aside\_port\_name) | Virtual Device UUID | `string` | n/a | yes | +| [aside\_vlan\_tag](#input\_aside\_vlan\_tag) | Vlan Tag information, outer vlanSTag for QINQ connections | `string` | n/a | yes | +| [aside\_vlan\_tag\_type](#input\_aside\_vlan\_tag\_type) | Vlan Tag Type; DOT1Q or QINQ | `string` | n/a | yes | +| [bandwidth\_limit](#input\_bandwidth\_limit) | Connection bandwidth limit in Mbps | `number` | n/a | yes | +| [connection\_type](#input\_connection\_type) | Type of Connection supported by Service Token you will create; EVPL\_VC, EVPLAN\_VC, EPLAN\_VC, IPWAN\_VC | `string` | n/a | yes | +| [equinix\_client\_id](#input\_equinix\_client\_id) | Equinix client ID (consumer key), obtained after registering app in the developer platform | `string` | n/a | yes | +| [equinix\_client\_secret](#input\_equinix\_client\_secret) | Equinix client secret ID (consumer secret), obtained after registering app in the developer platform | `string` | n/a | yes | +| [notifications\_emails](#input\_notifications\_emails) | Array of contact emails | `list(string)` | n/a | yes | +| [notifications\_type](#input\_notifications\_type) | Notification Type - ALL is the only type currently supported | `string` | n/a | yes | +| [service\_token\_description](#input\_service\_token\_description) | Service Token Description | `string` | n/a | yes | +| [service\_token\_expiration\_date\_time](#input\_service\_token\_expiration\_date\_time) | Expiration date and time of the service token; 2020-11-06T07:00:00 | `string` | n/a | yes | +| [service\_token\_name](#input\_service\_token\_name) | Service Token Name | `string` | n/a | yes | +| [service\_token\_type](#input\_service\_token\_type) | Service Token Type; VC\_TOKEN,EPL\_TOKEN | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [service-token](#output\_service-token) | n/a | +| [service\_token\_id](#output\_service\_token\_id) | n/a | diff --git a/examples/service-token-for-zside-network/README.md b/examples/service-token-for-zside-network/README.md index 969b7cb..e45c8a8 100644 --- a/examples/service-token-for-zside-network/README.md +++ b/examples/service-token-for-zside-network/README.md @@ -8,4 +8,212 @@ you see used in this example it will allow you to create a more specific use cas See example usage below for details on how to use this example. +## Equinix Fabric Developer Documentation + +To see the documentation for the APIs that the Fabric Terraform Provider is built on +and to learn how to procure your own Client_Id and Client_Secret follow the link below: +[Equinix Fabric Developer Portal](https://developer.equinix.com/docs?page=/dev-docs/fabric/overview) + +## Usage of Example as Terraform Module + +To provision this example directly as a usable module please use the *Provision Instructions* provided by Hashicorp +in the upper right of this page and be sure to include at a minimum the required variables. + +## Usage of Example Locally or in Your Own Configuration + +*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources. + +To provision this example directly, +you should clone the github repository for this module and run terraform within this directory: + +```bash +git clone https://github.com/equinix/terraform-equinix-fabric.git +cd terraform-equinix-fabric/examples/service-token-for-zside-network +terraform init +terraform apply +``` + +To use this example of the module in your own terraform configuration include the following: + +*NOTE: terraform.tfvars must be a separate file, but all other content can be placed together in main.tf if you prefer* + +terraform.tfvars (Replace these values with your own): +```hcl +equinix_client_id = "" +equinix_client_secret = "" + +#Service Token +service_token_type = "VC_TOKEN" +service_token_name = "Terra_Test_Token" +service_token_description = "Zside VD Token Test" +service_token_expiration_date_time = "2024-12-29T06:43:49.980Z" +notifications_type = "ALL" +notifications_emails = ["example@equinix.com"] +connection_type = "EVPL_VC" +supported_bandwidths = [50,100, 500, 1000] +zside_ap_type = "NETWORK" +zside_network_uuid = "" +``` + +versions.tf +```hcl +terraform { + required_version = ">= 1.5.4" + required_providers { + equinix = { + source="equinix/equinix" + version = ">= 3.1.0" + } + } +} +``` + +variables.tf + ```hcl +variable "equinix_client_id" { + description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" + type = string + sensitive = true +} +variable "equinix_client_secret" { + description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" + type = string + sensitive = true +} + +#Service Token +variable "service_token_name" { + description = "Service Token Name" + type = string +} +variable "service_token_type" { + description = "Service Token Type; VC_TOKEN,EPL_TOKEN" + type = string +} +variable "service_token_description" { + description = "Service Token Description" + type = string +} +variable "service_token_expiration_date_time" { + description = "Expiration date and time of the service token; 2020-11-06T07:00:00" + type = string +} +variable "notifications_type" { + description = "Notification Type - ALL is the only type currently supported" + type = string +} +variable "notifications_emails" { + description = "Array of contact emails" + type = list(string) +} +variable "connection_type" { + description = "Type of Connection supported by Service Token you will create; EVPL_VC, EVPLAN_VC, EPLAN_VC, IPWAN_VC" + type = string +} +variable "supported_bandwidths" { + description = "List of permitted bandwidths" + type = list +} +variable "zside_ap_type" { + description = "Type of Access point; COLO, VD, NETWORK" + type = string +} +variable "zside_network_type" { + description = "Network type" + type = string +} +variable "zside_network_uuid" { + description = "Network UUID" + type = string +} +``` + +outputs.tf +```hcl +output "service_token_id" { + value = equinix_fabric_service_token.service-token.id +} +output "service-token" { + value = equinix_fabric_service_token.service-token +} +``` + +main.tf +```hcl +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret +} + +resource "equinix_fabric_service_token" "service-token" { + type = var.service_token_type + name = var.service_token_name + description = var.service_token_description + expiration_date_time = var.service_token_expiration_date_time + notifications { + type = var.notifications_type + emails = var.notifications_emails + } + service_token_connection { + type = var.connection_type + supported_bandwidths = var.supported_bandwidths + z_side { + access_point_selectors { + type = var.zside_ap_type + network { + uuid = var.zside_network_uuid + } + } + } + } +} +``` + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.5.4 | +| [equinix](#requirement\_equinix) | >= 3.1.0 | + +## Providers + +| Name | Version | +|------|---------| +| [equinix](#provider\_equinix) | >= 3.1.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [equinix_fabric_service_token.service-token](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/fabric_service_token) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [connection\_type](#input\_connection\_type) | Type of Connection supported by Service Token you will create; EVPL\_VC, EVPLAN\_VC, EPLAN\_VC, IPWAN\_VC | `string` | n/a | yes | +| [equinix\_client\_id](#input\_equinix\_client\_id) | Equinix client ID (consumer key), obtained after registering app in the developer platform | `string` | n/a | yes | +| [equinix\_client\_secret](#input\_equinix\_client\_secret) | Equinix client secret ID (consumer secret), obtained after registering app in the developer platform | `string` | n/a | yes | +| [notifications\_emails](#input\_notifications\_emails) | Array of contact emails | `list(string)` | n/a | yes | +| [notifications\_type](#input\_notifications\_type) | Notification Type - ALL is the only type currently supported | `string` | n/a | yes | +| [service\_token\_description](#input\_service\_token\_description) | Service Token Description | `string` | n/a | yes | +| [service\_token\_expiration\_date\_time](#input\_service\_token\_expiration\_date\_time) | Expiration date and time of the service token; 2020-11-06T07:00:00 | `string` | n/a | yes | +| [service\_token\_name](#input\_service\_token\_name) | Service Token Name | `string` | n/a | yes | +| [service\_token\_type](#input\_service\_token\_type) | Service Token Type; VC\_TOKEN,EPL\_TOKEN | `string` | n/a | yes | +| [supported\_bandwidths](#input\_supported\_bandwidths) | List of permitted bandwidths | `list` | n/a | yes | +| [zside\_ap\_type](#input\_zside\_ap\_type) | Type of Access point; COLO, VD, NETWORK | `string` | n/a | yes | +| [zside\_network\_type](#input\_zside\_network\_type) | Network type | `string` | n/a | yes | +| [zside\_network\_uuid](#input\_zside\_network\_uuid) | Network UUID | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [service-token](#output\_service-token) | n/a | +| [service\_token\_id](#output\_service\_token\_id) | n/a | diff --git a/examples/service-token-for-zside-port/README.md b/examples/service-token-for-zside-port/README.md index 0ea1066..0b9b4ab 100644 --- a/examples/service-token-for-zside-port/README.md +++ b/examples/service-token-for-zside-port/README.md @@ -8,4 +8,236 @@ you see used in this example it will allow you to create a more specific use cas See example usage below for details on how to use this example. +## Equinix Fabric Developer Documentation + +To see the documentation for the APIs that the Fabric Terraform Provider is built on +and to learn how to procure your own Client_Id and Client_Secret follow the link below: +[Equinix Fabric Developer Portal](https://developer.equinix.com/docs?page=/dev-docs/fabric/overview) + +## Usage of Example as Terraform Module + +To provision this example directly as a usable module please use the *Provision Instructions* provided by Hashicorp +in the upper right of this page and be sure to include at a minimum the required variables. + +## Usage of Example Locally or in Your Own Configuration + +*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources. + +To provision this example directly, +you should clone the github repository for this module and run terraform within this directory: + +```bash +git clone https://github.com/equinix/terraform-equinix-fabric.git +cd terraform-equinix-fabric/examples/service-token-for-zside-port +terraform init +terraform apply +``` + +To use this example of the module in your own terraform configuration include the following: + +*NOTE: terraform.tfvars must be a separate file, but all other content can be placed together in main.tf if you prefer* + +terraform.tfvars (Replace these values with your own): +```hcl +equinix_client_id = "" +equinix_client_secret = "" + +#Service Token +service_token_type = "VC_TOKEN" +service_token_name = "Terra_Test_Token" +service_token_description = "Zside VD Token Test" +service_token_expiration_date_time = "2024-12-29T06:43:49.980Z" +notifications_type = "ALL" +notifications_emails = ["example@equinix.com"] +connection_type = "EVPL_VC" +supported_bandwidths = [50,100, 500, 1000] +zside_ap_type = "COLO" +zside_port_name = "" +zside_vlan_tag_type = "DOT1Q" +zside_vlan_tag = "2876" +``` + +versions.tf +```hcl +terraform { + required_version = ">= 1.5.4" + required_providers { + equinix = { + source="equinix/equinix" + version = ">= 3.1.0" + } + } +} +``` + +variables.tf + ```hcl +variable "equinix_client_id" { + description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" + type = string + sensitive = true +} +variable "equinix_client_secret" { + description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" + type = string + sensitive = true +} + +#Service Token +variable "service_token_name" { + description = "Service Token Name" + type = string +} +variable "service_token_type" { + description = "Service Token Type; VC_TOKEN,EPL_TOKEN" + type = string +} +variable "service_token_description" { + description = "Service Token Description" + type = string +} +variable "service_token_expiration_date_time" { + description = "Expiration date and time of the service token; 2020-11-06T07:00:00" + type = string +} +variable "notifications_type" { + description = "Notification Type - ALL is the only type currently supported" + type = string +} +variable "notifications_emails" { + description = "Array of contact emails" + type = list(string) +} +variable "connection_type" { + description = "Type of Connection supported by Service Token you will create; EVPL_VC, EVPLAN_VC, EPLAN_VC, IPWAN_VC" + type = string +} +variable "supported_bandwidths" { + description = "List of permitted bandwidths" + type = list +} +variable "allow_remote_connection" { + description = "allowRemoteConnection" + type = bool +} +variable "zside_ap_type" { + description = "Type of Access point; COLO, VD, NETWORK" + type = string +} +variable "zside_port_name" { + description = "Virtual Device UUID" + type = string +} +variable "zside_vlan_tag_type" { + description = "Vlan Tag Type; DOT1Q or QINQ" + type = string +} +variable "zside_vlan_tag" { + description = "Vlan Tag information, outer vlanSTag for QINQ connections" + type = string +} +``` + +outputs.tf +```hcl +output "service-token_id" { + value = equinix_fabric_service_token.service-token.id +} +output "service-token" { + value = equinix_fabric_service_token.service-token +} +``` + +main.tf +```hcl +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret +} +data "equinix_fabric_ports" "zside_port" { + filters { + name = var.zside_port_name + } +} + +resource "equinix_fabric_service_token" "service-token" { + type = var.service_token_type + name = var.service_token_name + description = var.service_token_description + expiration_date_time = var.service_token_expiration_date_time + notifications { + type = var.notifications_type + emails = var.notifications_emails + } + + service_token_connection { + type = var.connection_type + supported_bandwidths = var.supported_bandwidths + allow_remote_connection = var.allow_remote_connection + z_side { + access_point_selectors { + type = var.zside_ap_type + port { + uuid = data.equinix_fabric_ports.zside_port.data.0.uuid + } + link_protocol { + type = var.zside_vlan_tag_type + vlan_tag = var.zside_vlan_tag + } + } + } + } +} +``` + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.5.4 | +| [equinix](#requirement\_equinix) | >= 3.1.0 | + +## Providers + +| Name | Version | +|------|---------| +| [equinix](#provider\_equinix) | >= 3.1.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [equinix_fabric_service_token.service-token](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/fabric_service_token) | resource | +| [equinix_fabric_ports.zside_port](https://registry.terraform.io/providers/equinix/equinix/latest/docs/data-sources/fabric_ports) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [allow\_remote\_connection](#input\_allow\_remote\_connection) | allowRemoteConnection | `bool` | n/a | yes | +| [connection\_type](#input\_connection\_type) | Type of Connection supported by Service Token you will create; EVPL\_VC, EVPLAN\_VC, EPLAN\_VC, IPWAN\_VC | `string` | n/a | yes | +| [equinix\_client\_id](#input\_equinix\_client\_id) | Equinix client ID (consumer key), obtained after registering app in the developer platform | `string` | n/a | yes | +| [equinix\_client\_secret](#input\_equinix\_client\_secret) | Equinix client secret ID (consumer secret), obtained after registering app in the developer platform | `string` | n/a | yes | +| [notifications\_emails](#input\_notifications\_emails) | Array of contact emails | `list(string)` | n/a | yes | +| [notifications\_type](#input\_notifications\_type) | Notification Type - ALL is the only type currently supported | `string` | n/a | yes | +| [service\_token\_description](#input\_service\_token\_description) | Service Token Description | `string` | n/a | yes | +| [service\_token\_expiration\_date\_time](#input\_service\_token\_expiration\_date\_time) | Expiration date and time of the service token; 2020-11-06T07:00:00 | `string` | n/a | yes | +| [service\_token\_name](#input\_service\_token\_name) | Service Token Name | `string` | n/a | yes | +| [service\_token\_type](#input\_service\_token\_type) | Service Token Type; VC\_TOKEN,EPL\_TOKEN | `string` | n/a | yes | +| [supported\_bandwidths](#input\_supported\_bandwidths) | List of permitted bandwidths | `list` | n/a | yes | +| [zside\_ap\_type](#input\_zside\_ap\_type) | Type of Access point; COLO, VD, NETWORK | `string` | n/a | yes | +| [zside\_port\_name](#input\_zside\_port\_name) | Virtual Device UUID | `string` | n/a | yes | +| [zside\_vlan\_tag](#input\_zside\_vlan\_tag) | Vlan Tag information, outer vlanSTag for QINQ connections | `string` | n/a | yes | +| [zside\_vlan\_tag\_type](#input\_zside\_vlan\_tag\_type) | Vlan Tag Type; DOT1Q or QINQ | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [service-token](#output\_service-token) | n/a | +| [service-token\_id](#output\_service-token\_id) | n/a | diff --git a/examples/service-token-for-zside-virtual-device/README.md b/examples/service-token-for-zside-virtual-device/README.md index 48536ec..8e248a3 100644 --- a/examples/service-token-for-zside-virtual-device/README.md +++ b/examples/service-token-for-zside-virtual-device/README.md @@ -82,7 +82,6 @@ zside_ap_type = "VD" zside_vd_type = "EDGE" zside_vd_uuid = "" zside_interface_type = "NETWORK" -zside_interface_id = "3" ``` versions.tf @@ -92,7 +91,7 @@ terraform { required_providers { equinix = { source = "equinix/equinix" - version = ">= 2.10.0" + version = ">= 3.1.0" } } } @@ -247,10 +246,6 @@ variable "zside_interface_type" { description = "Interface Type" type = string } -variable "zside_interface_id" { - description = "Interface Id" - type = string -} ``` outputs.tf @@ -339,13 +334,13 @@ resource "equinix_fabric_service_token" "service-token" { | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.5.4 | -| [equinix](#requirement\_equinix) | >= 2.10.0 | +| [equinix](#requirement\_equinix) | >= 3.1.0 | ## Providers | Name | Version | |------|---------| -| [equinix](#provider\_equinix) | >= 2.10.0 | +| [equinix](#provider\_equinix) | >= 3.1.0 | ## Modules @@ -394,7 +389,6 @@ No modules. | [template\_src\_port](#input\_template\_src\_port) | Inbound traffic source ports | `string` | n/a | yes | | [template\_subnet](#input\_template\_subnet) | Inbound traffic source IP subnets in CIDR format | `string` | n/a | yes | | [zside\_ap\_type](#input\_zside\_ap\_type) | Type of Access point; COLO, VD, NETWORK | `string` | n/a | yes | -| [zside\_interface\_id](#input\_zside\_interface\_id) | Interface Id | `string` | n/a | yes | | [zside\_interface\_type](#input\_zside\_interface\_type) | Interface Type | `string` | n/a | yes | | [zside\_vd\_type](#input\_zside\_vd\_type) | Virtual Device type - EDGE | `string` | n/a | yes | | [zside\_vd\_uuid](#input\_zside\_vd\_uuid) | Virtual Device UUID | `string` | n/a | yes |