diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index c1d5d240..b2ca6608 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -20,7 +20,7 @@ jobs: with: ref: main - - name: Render terraform docs inside the main and the modules README.md files and push changes back to PR branch + - name: Render terraform docs inside the main, modules, and examples README.md files and push changes back to PR branch id: terraform-docs uses: terraform-docs/gh-actions@v1.0.0 with: @@ -50,4 +50,4 @@ jobs: signoff: true delete-branch: true - # TODO(ocobleseqx): https://github.com/peter-evans/enable-pull-request-automerge \ No newline at end of file + # TODO(ocobleseqx): https://github.com/peter-evans/enable-pull-request-automerge diff --git a/README.md b/README.md index 8a91176d..9d28204d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ [![Terraform version](https://img.shields.io/badge/terraform-%3E%3D1.5.4-623CE4.svg?style=flat-square&logo=terraform)](https://github.com/hashicorp/terraform) [![Terraform registry](https://img.shields.io/badge/terraform-registry-623CE4.svg?style=flat-square&logo=terraform)](https://registry.terraform.io/modules/equinix/fabric/equinix/latest) -> This is a empty module that houses multiple submodules for Equinix Fabric Terraform usage. +> This is a empty module that houses multiple submodules for Equinix Fabric Terraform usage. Please view the Submodules +> and the Examples in this module's registry to view details on what they are and how to leverage them. ## Equinix Fabric Developer Documentation diff --git a/examples/cloud-router-2-aws-connection/README.md b/examples/cloud-router-2-aws-connection/README.md index 03814019..8fb66184 100644 --- a/examples/cloud-router-2-aws-connection/README.md +++ b/examples/cloud-router-2-aws-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Cloud Router to AWS Service Profile Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to AWS Service Profile. + +It leverages the Equinix Terraform Provider, the AWS Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -50,10 +63,10 @@ additional_info = [ { key = "accessKey", value = "" }, { key = "secretKey", value = "" } ] - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -63,10 +76,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -146,17 +159,15 @@ variable "additional_info" { type = list(object({ key = string, value = string })) default = [] } - ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_aws_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -171,7 +182,7 @@ module "cloud_router_aws_connection" { connection_type = var.connection_type notifications_type = var.notifications_type notifications_emails = var.notifications_emails - additional_info = [{ key = "accessKey", value = var.aws_access_key }, { key = "secretKey", value = var.aws_secret_key }] + additional_info = var.additional_info bandwidth = var.bandwidth purchase_order_number = var.purchase_order_number @@ -188,7 +199,7 @@ module "cloud_router_aws_connection" { zside_fabric_sp_name = var.zside_fabric_sp_name } ``` - + ## Requirements @@ -238,4 +249,4 @@ No resources. | Name | Description | |------|-------------| | [module\_output](#output\_module\_output) | n/a | - \ No newline at end of file + diff --git a/examples/cloud-router-2-azure-connection/README.md b/examples/cloud-router-2-azure-connection/README.md index 83ba577a..3fb3840a 100644 --- a/examples/cloud-router-2-azure-connection/README.md +++ b/examples/cloud-router-2-azure-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Cloud Router to Azure Service Profile Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to Azure Service Profile. + +It leverages the Equinix Terraform Provider, the Azure Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -46,10 +59,21 @@ zside_ap_profile_type = "L2_PROFILE" zside_location = "SV" zside_peering_type = "PRIVATE" zside_fabric_sp_name = "Azure ExpressRoute" - +azure_client_id = "" +azure_client_secret = "" +azure_tenant_id = "" +azure_subscription_id = "" +azure_location = "West US 2" +azure_service_key_name = "Test_Azure_Key" +azure_service_provider_name = "" +azure_peering_location = "Silicon Valley Test" +azure_tier = "Standard" +azure_family = "UnlimitedData" +azure_environment = "PROD" ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -57,12 +81,16 @@ terraform { source = "equinix/equinix" version = ">= 1.20.0" } + azurerm = { + source = "hashicorp/azurerm" + version = "3.84.0" + } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -106,12 +134,6 @@ variable "aside_fcr_uuid" { description = "Equinix-assigned Fabric Cloud Router identifier" type = string } - -variable "zside_ap_authentication_key" { - description = "Authentication key for provider based connections" - type = string - default = "" -} variable "zside_ap_type" { description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW" type = string @@ -137,24 +159,100 @@ variable "zside_fabric_sp_name" { type = string default = "" } - +variable "azure_client_id" { + description = "Azure Client id" + type = string +} +variable "azure_client_secret" { + description = "Azure Secret value" + type = string +} +variable "azure_tenant_id" { + description = "Azure Tenant id" + type = string +} +variable "azure_subscription_id" { + description = "Azure Subscription id" + type = string +} +variable "azure_resource_name" { + description = "The name of Azure Resource" + type = string +} +variable "azure_location" { + description = "The Location of Azure service provider(resource)" + type = string +} +variable "azure_service_key_name" { + description = "Azure Service Key Name" + type = string +} +variable "azure_service_provider_name" { + description = "The name of Azure Service Provider" + type = string + default = "" +} +variable "azure_peering_location" { + description = "The name of the peering location (not the Azure resource location)" + type = string + default = "" +} +variable "azure_tier" { + description = "The Service tier. Possible values are Basic, Local, Standard or Premium" + type = string +} +variable "azure_family" { + description = "The billing mode for bandwidth. Possible values are MeteredData or UnlimitedData" + type = string +} +variable "azure_environment" { + description = "The Cloud environment which should be used for Service Key" + type = string +} ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_azure_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { client_id = var.equinix_client_id client_secret = var.equinix_client_secret } - +provider "azurerm" { + features {} + client_id = var.azure_client_id + client_secret = var.azure_client_secret + tenant_id = var.azure_tenant_id + subscription_id = var.azure_subscription_id + + skip_provider_registration = true +} +resource "azurerm_resource_group" "fcr2azure" { + name = var.azure_resource_name + location = var.azure_location +} +resource "azurerm_express_route_circuit" "fcr2azure" { + name = var.azure_service_key_name + resource_group_name = azurerm_resource_group.fcr2azure.name + location = azurerm_resource_group.fcr2azure.location + service_provider_name = var.azure_service_provider_name + peering_location = var.azure_peering_location + bandwidth_in_mbps = var.bandwidth + sku { + tier = var.azure_tier + family = var.azure_family + } + allow_classic_operations = false + tags = { + environment = var.azure_environment + } +} module "cloud_router_azure_connection" { source = "equinix/fabric/equinix//modules/cloud-router-connection" @@ -162,7 +260,7 @@ module "cloud_router_azure_connection" { connection_type = var.connection_type notifications_type = var.notifications_type notifications_emails = var.notifications_emails - bandwidth = var.bandwidth + bandwidth = azurerm_express_route_circuit.fcr2azure.bandwidth_in_mbps purchase_order_number = var.purchase_order_number #Aside @@ -171,14 +269,14 @@ module "cloud_router_azure_connection" { #Zside zside_ap_type = var.zside_ap_type - zside_ap_authentication_key = var.zside_ap_authentication_key + zside_ap_authentication_key = azurerm_express_route_circuit.fcr2azure.service_key zside_ap_profile_type = var.zside_ap_profile_type zside_location = var.zside_location zside_peering_type = var.zside_peering_type zside_fabric_sp_name = var.zside_fabric_sp_name } ``` - + ## Requirements @@ -244,4 +342,4 @@ module "cloud_router_azure_connection" { | Name | Description | |------|-------------| | [module\_output](#output\_module\_output) | n/a | - \ No newline at end of file + diff --git a/examples/cloud-router-2-azure-redundant-connection/README.md b/examples/cloud-router-2-azure-redundant-connection/README.md index a5d3308d..625d696a 100644 --- a/examples/cloud-router-2-azure-redundant-connection/README.md +++ b/examples/cloud-router-2-azure-redundant-connection/README.md @@ -1,3 +1,16 @@ +# Fabric Cloud Router to Azure Service Profile Redundant Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to Azure Service Profile using two connections. A primary and +secondary connection. + +It leverages the Equinix Terraform Provider, the Azure Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +41,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -50,10 +64,21 @@ zside_location = "SV" zside_peering_type = "PRIVATE" zside_seller_region = "us-west-1" zside_fabric_sp_name = "Azure ExpressRoute" - +azure_client_id = "" +azure_client_secret = "" +azure_tenant_id = "" +azure_subscription_id = "" +azure_location = "West US 2" +azure_service_key_name = "Test_Azure_Key" +azure_service_provider_name = "" +azure_peering_location = "Silicon Valley Test" +azure_tier = "Standard" +azure_family = "UnlimitedData" +azure_environment = "PROD" ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -61,12 +86,16 @@ terraform { source = "equinix/equinix" version = ">= 1.20.0" } + azurerm = { + source = "hashicorp/azurerm" + version = "3.84.0" + } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -111,11 +140,6 @@ variable "aside_fcr_uuid" { description = "Equinix-assigned Fabric Cloud Router identifier" type = string } -variable "zside_ap_authentication_key" { - description = "Authentication key for provider based connections" - type = string - default = "" -} variable "zside_ap_type" { description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW" type = string @@ -150,37 +174,109 @@ variable "aside_sec_fcr_uuid" { type = string default = "" } -variable "secondary_bandwidth" { - description = "Connection bandwidth in Mbps" - type = number - default = 50 -} variable "secondary_redundancy" { description = "Redundancy Priority for the Secondary connection" type = string default = "SECONDARY" } +variable "azure_client_id" { + description = "Azure Client id" + type = string +} +variable "azure_client_secret" { + description = "Azure Secret value" + type = string +} +variable "azure_tenant_id" { + description = "Azure Tenant id" + type = string +} +variable "azure_subscription_id" { + description = "Azure Subscription id" + type = string +} +variable "azure_resource_name" { + description = "The name of Azure Resource" + type = string +} +variable "azure_location" { + description = "The Location of Azure service provider(resource)" + type = string +} +variable "azure_service_key_name" { + description = "Azure Service Key Name" + type = string +} +variable "azure_service_provider_name" { + description = "The name of Azure Service Provider" + type = string + default = "" +} +variable "azure_peering_location" { + description = "The name of the peering location (not the Azure resource location)" + type = string + default = "" +} +variable "azure_tier" { + description = "The Service tier. Possible values are Basic, Local, Standard or Premium" + type = string +} +variable "azure_family" { + description = "The billing mode for bandwidth. Possible values are MeteredData or UnlimitedData" + type = string +} +variable "azure_environment" { + description = "The Cloud environment which should be used for Service Key" + type = string +} ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_azure_redundant_connection.primary_connection_id } output "secondary_connection_result" { value = var.secondary_connection_name != "" ? module.cloud_router_azure_redundant_connection.secondary_connection_id : null } - ``` main.tf: - ```hcl provider "equinix" { client_id = var.equinix_client_id client_secret = var.equinix_client_secret } - +provider "azurerm" { + features {} + client_id = var.azure_client_id + client_secret = var.azure_client_secret + tenant_id = var.azure_tenant_id + subscription_id = var.azure_subscription_id + + skip_provider_registration = true +} +resource "azurerm_resource_group" "fcr2azure" { + name = var.azure_resource_name + location = var.azure_location +} +resource "azurerm_express_route_circuit" "fcr2azure" { + name = var.azure_service_key_name + resource_group_name = azurerm_resource_group.fcr2azure.name + location = azurerm_resource_group.fcr2azure.location + service_provider_name = var.azure_service_provider_name + peering_location = var.azure_peering_location + bandwidth_in_mbps = var.bandwidth + sku { + tier = var.azure_tier + family = var.azure_family + } + allow_classic_operations = false + tags = { + environment = var.azure_environment + } +} module "cloud_router_azure_redundant_connection" { source = "equinix/fabric/equinix//modules/cloud-router-connection" @@ -189,7 +285,7 @@ module "cloud_router_azure_redundant_connection" { connection_type = var.connection_type notifications_type = var.notifications_type notifications_emails = var.notifications_emails - bandwidth = var.bandwidth + bandwidth = azurerm_express_route_circuit.fcr2azure.bandwidth_in_mbps purchase_order_number = var.purchase_order_number #Aside @@ -198,7 +294,7 @@ module "cloud_router_azure_redundant_connection" { #Zside zside_ap_type = var.zside_ap_type - zside_ap_authentication_key = var.zside_ap_authentication_key + zside_ap_authentication_key = azurerm_express_route_circuit.fcr2azure.service_key zside_ap_profile_type = var.zside_ap_profile_type zside_location = var.zside_location zside_fabric_sp_name = var.zside_fabric_sp_name @@ -206,10 +302,11 @@ module "cloud_router_azure_redundant_connection" { #Secondary-Connection secondary_connection_name = var.secondary_connection_name - secondary_bandwidth = var.secondary_bandwidth + secondary_bandwidth = azurerm_express_route_circuit.fcr2azure.service_key aside_sec_fcr_uuid = var.aside_sec_fcr_uuid } ``` + ## Requirements @@ -280,4 +377,4 @@ module "cloud_router_azure_redundant_connection" { |------|-------------| | [module\_output](#output\_module\_output) | n/a | | [secondary\_connection\_result](#output\_secondary\_connection\_result) | n/a | - \ No newline at end of file + diff --git a/examples/cloud-router-2-gcp-connection/README.md b/examples/cloud-router-2-gcp-connection/README.md index 9b463d2f..88268209 100644 --- a/examples/cloud-router-2-gcp-connection/README.md +++ b/examples/cloud-router-2-gcp-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Cloud Router to Google Service Profile Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to Google Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -46,10 +59,10 @@ zside_ap_profile_type = "L2_PROFILE" zside_location = "SV" zside_seller_region = "us-west-1" zside_fabric_sp_name = "Google Cloud Partner Interconnect Zone 1" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -59,10 +72,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -137,17 +150,15 @@ variable "zside_seller_region" { type = string default = "" } - ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_gcp_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -178,7 +189,7 @@ module "cloud_router_gcp_connection" { zside_fabric_sp_name = var.zside_fabric_sp_name } ``` - + ## Requirements @@ -227,4 +238,4 @@ No resources. | Name | Description | |------|-------------| | [module\_output](#output\_module\_output) | n/a | - \ No newline at end of file + diff --git a/examples/cloud-router-2-oracle-connection/README.md b/examples/cloud-router-2-oracle-connection/README.md index 14273da8..f85c136f 100644 --- a/examples/cloud-router-2-oracle-connection/README.md +++ b/examples/cloud-router-2-oracle-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Cloud Router to Oracle Service Profile Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to Oracle Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -47,10 +60,10 @@ zside_location = "SV" zside_peering_type = "PRIVATE" zside_seller_region = "us-ashburn-1" zside_fabric_sp_name = "Oracle Cloud Infrastructure -OCI- FastConnect" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -60,10 +73,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -141,17 +154,15 @@ variable "zside_fabric_sp_name" { type = string default = "" } - ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_oracle_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -183,7 +194,7 @@ module "cloud_router_oracle_connection" { zside_fabric_sp_name = var.zside_fabric_sp_name } ``` - + ## Requirements @@ -233,4 +244,4 @@ No resources. | Name | Description | |------|-------------| | [module\_output](#output\_module\_output) | n/a | - \ No newline at end of file + diff --git a/examples/cloud-router-2-port-connection/README.md b/examples/cloud-router-2-port-connection/README.md index 270ac3dd..9dc55eb4 100644 --- a/examples/cloud-router-2-port-connection/README.md +++ b/examples/cloud-router-2-port-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Cloud Router to Fabric Port Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to Fabric Port. + +It leverages the Equinix Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -44,10 +57,10 @@ zside_ap_type = "COLO" zside_vlan_outer_tag = "2711" zside_location = "SV" zside_port_name = "" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -57,10 +70,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -123,17 +136,15 @@ variable "zside_location" { default = "SP" } - ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_port_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -162,7 +173,7 @@ module "cloud_router_port_connection" { zside_vlan_tag = var.zside_vlan_outer_tag } ``` - + ## Requirements @@ -209,4 +220,4 @@ No resources. | Name | Description | |------|-------------| | [module\_output](#output\_module\_output) | n/a | - \ No newline at end of file + diff --git a/examples/cloud-router-2-service-profile-connection/README.md b/examples/cloud-router-2-service-profile-connection/README.md index 18cf8b44..cf211afb 100644 --- a/examples/cloud-router-2-service-profile-connection/README.md +++ b/examples/cloud-router-2-service-profile-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Cloud Router to Fabric Service Profile Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to Fabric Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -44,10 +57,10 @@ zside_ap_type = "SP" zside_ap_profile_type = "L2_PROFILE" zside_location = "SV" zside_fabric_sp_name = "Ajith Ops User QnQ" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -57,10 +70,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -124,17 +137,15 @@ variable "zside_fabric_sp_name" { type = string default = "" } - ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_sp_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -163,7 +174,7 @@ module "cloud_router_sp_connection" { zside_fabric_sp_name = var.zside_fabric_sp_name } ``` - + ## Requirements @@ -210,4 +221,4 @@ No resources. | Name | Description | |------|-------------| | [module\_output](#output\_module\_output) | n/a | - \ No newline at end of file + diff --git a/examples/cloud-router-2-wan-connection/README.md b/examples/cloud-router-2-wan-connection/README.md index b1f3c8a4..cd69336f 100644 --- a/examples/cloud-router-2-wan-connection/README.md +++ b/examples/cloud-router-2-wan-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Cloud Router to Fabric Network Connection + +This example shows how to leverage the [Fabric Cloud Router Connection Module](../../modules/cloud-router-connection/README.md) +to create a Fabric Connection from a Fabric Cloud Router to Fabric Network. + +It leverages the Equinix Terraform Provider, and the Fabric Cloud Router Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -42,10 +55,10 @@ aside_ap_type = "CLOUD_ROUTER" aside_fcr_uuid = "" zside_ap_type = "NETWORK" zside_network_uuid = "" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -55,10 +68,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -111,17 +124,15 @@ variable "zside_network_uuid" { description = "Network UUID" default = "" } - ``` outputs.tf: - ```hcl +```hcl + output "module_output" { value = module.cloud_router_wan_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -148,7 +159,7 @@ module "cloud_router_wan_connection" { zside_network_uuid = var.zside_network_uuid } ``` - + ## Requirements @@ -193,4 +204,4 @@ No resources. | Name | Description | |------|-------------| | [module\_output](#output\_module\_output) | n/a | - \ No newline at end of file + diff --git a/examples/metal-2-fabric-aws-connection/README.md b/examples/metal-2-fabric-aws-connection/README.md deleted file mode 100644 index f139fb43..00000000 --- a/examples/metal-2-fabric-aws-connection/README.md +++ /dev/null @@ -1,65 +0,0 @@ - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 1.5.2 | -| [equinix](#requirement\_equinix) | >= 1.20.0 | - -## Providers - -| Name | Version | -|------|---------| -| [equinix](#provider\_equinix) | >= 1.20.0 | -| [random](#provider\_random) | n/a | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [metal-2-fabric-connection](#module\_metal-2-fabric-connection) | ../../modules/service-token-connection | n/a | - -## Resources - -| Name | Type | -|------|------| -| [equinix_metal_connection.metal-connection](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_connection) | resource | -| [equinix_metal_device.s1](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_device) | resource | -| [equinix_metal_device_network_type.s1-network-type](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_device_network_type) | resource | -| [equinix_metal_port_vlan_attachment.s1-attachment](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_port_vlan_attachment) | resource | -| [equinix_metal_vlan.vlan-server-1](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_vlan) | resource | -| [random_string.random](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [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 | -| [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 | -| [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal Authentication API Token | `string` | n/a | yes | -| [metal\_connection\_metro](#input\_metal\_connection\_metro) | Metro where the connection will be created | `string` | n/a | yes | -| [metal\_project\_id](#input\_metal\_project\_id) | Metal Project Name | `string` | n/a | yes | -| [notifications\_emails](#input\_notifications\_emails) | Array of contact emails | `list(string)` | n/a | yes | -| [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\_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 | -| [additional\_info](#input\_additional\_info) | Additional info parameters. It's a list of maps containing 'key' and 'value' keys with their corresponding values. | `list(object({ key = string, value = string }))` | `[]` | no | -| [connection\_speed](#input\_connection\_speed) | Speed/Bandwidth to be allocated to the connection - (MB or GB) | `number` | `50` | no | -| [metal\_connection\_description](#input\_metal\_connection\_description) | Description for the connection resource | `string` | `"Connect from Equinix Metal to Service provider using a-side token"` | no | -| [metal\_connection\_speed\_unit](#input\_metal\_connection\_speed\_unit) | Unit of the speed/bandwidth to be allocated to the connection | `string` | `"MB"` | no | -| [notifications\_type](#input\_notifications\_type) | Notification Type - ALL is the only type currently supported | `string` | `"ALL"` | no | -| [purchase\_order\_number](#input\_purchase\_order\_number) | Purchase order number | `string` | `""` | no | -| [zside\_ap\_type](#input\_zside\_ap\_type) | Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW | `string` | `""` | no | -| [zside\_location](#input\_zside\_location) | Access point metro code | `string` | `""` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [fabric-connection](#output\_fabric-connection) | n/a | -| [metal-connection](#output\_metal-connection) | n/a | - \ No newline at end of file diff --git a/examples/port-2-alibaba-connection/README.md b/examples/port-2-alibaba-connection/README.md index bcd0482a..ba3ce871 100644 --- a/examples/port-2-alibaba-connection/README.md +++ b/examples/port-2-alibaba-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric Alibaba Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Alibaba Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -46,10 +59,10 @@ zside_ap_profile_type = "L2_PROFILE" zside_location = "SY" zside_sp_name = "Alibaba Cloud Express Connect" zside_seller_region = "ap-southeast-2" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -59,10 +72,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -137,17 +150,15 @@ variable "zside_seller_region" { description = "Access point seller region" type = string } - ``` outputs.tf: - ```hcl +```hcl + output "alibaba_connection_id" { value = module.create_port_2_alibaba_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -178,7 +189,7 @@ module "create_port_2_alibaba_connection" { zside_sp_name = var.zside_sp_name } ``` - + ## Requirements @@ -228,4 +239,4 @@ No resources. | Name | Description | |------|-------------| | [alibaba\_connection\_id](#output\_alibaba\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-aws-connection/README.md b/examples/port-2-aws-connection/README.md index 6422f763..76c74487 100644 --- a/examples/port-2-aws-connection/README.md +++ b/examples/port-2-aws-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric AWS Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric AWS Service Profile. + +It leverages the Equinix Terraform Provider, the AWS Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -51,10 +64,10 @@ additional_info = [ { key = "accessKey", value = "" }, { key = "secretKey", value = "" } ] - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -64,10 +77,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -147,17 +160,15 @@ variable "additional_info" { type = list(object({ key = string, value = string })) default = [] } - ``` outputs.tf: - ```hcl +```hcl + output "aws_connection_id" { value = module.create_port_2_aws_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -190,7 +201,7 @@ module "create_port_2_aws_connection" { zside_sp_name = var.zside_sp_name } ``` - + ## Requirements diff --git a/examples/port-2-azure-connection/README.md b/examples/port-2-azure-connection/README.md index 8c91f1a0..50bcd521 100644 --- a/examples/port-2-azure-connection/README.md +++ b/examples/port-2-azure-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric Azure Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Azure Service Profile. + +It leverages the Equinix Terraform Provider, the Azure Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,9 +40,10 @@ To use this example of the module in your own terraform configuration include th *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" +```hcl + +equinix_client_id = "" +equinix_client_secret = "" connection_name = "Port2Azure" connection_type = "EVPL_VC" @@ -42,27 +55,41 @@ aside_port_name = "sit-001-200009-CX-TY4-NL-Qinq-STD-10G-PRI-JP-252" aside_vlan_tag = "2019" aside_vlan_inner_tag = "2022" zside_ap_type = "SP" -zside_ap_authentication_key = "" zside_ap_profile_type = "L2_PROFILE" zside_location = "SV" zside_sp_name = "Azure ExpressRoute" - +zside_peering_type = "PRIVATE" +azure_client_id = "" +azure_client_secret = "" +azure_tenant_id = "" +azure_subscription_id = "" +azure_location = "West US 2" +azure_service_key_name = "Test_Azure_Key" +azure_service_provider_name = "" +azure_peering_location = "Silicon Valley Test" +azure_tier = "Standard" +azure_family = "UnlimitedData" +azure_environment = "PROD" ``` versions.tf: - ```hcl +```hcl + terraform { - required_version = ">= 1.5.4" + required_version = ">= 1.5.2" required_providers { equinix = { source = "equinix/equinix" version = ">= 1.20.0" } + azurerm = { + source = "hashicorp/azurerm" + version = "3.84.0" + } } -} - -``` +}``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -71,7 +98,6 @@ variable "equinix_client_secret" { description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" type = string } - variable "connection_name" { description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores" type = string @@ -98,12 +124,10 @@ variable "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 @@ -117,10 +141,6 @@ 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 -} variable "zside_ap_profile_type" { description = "Service profile type - L2_PROFILE, L3_PROFILE, ECIA_PROFILE, ECMC_PROFILE" type = string @@ -133,24 +153,104 @@ variable "zside_sp_name" { description = "Equinix Service Profile Name" type = string } - +variable "zside_peering_type" { + description = "Zside Access Point Peering type. Available values; PRIVATE, MICROSOFT, PUBLIC, MANUAL" + type = string +} +variable "azure_client_id" { + description = "Azure Client id" + type = string +} +variable "azure_client_secret" { + description = "Azure Secret value" + type = string +} +variable "azure_tenant_id" { + description = "Azure Tenant id" + type = string +} +variable "azure_subscription_id" { + description = "Azure Subscription id" + type = string +} +variable "azure_resource_name" { + description = "The name of Azure Resource" + type = string +} +variable "azure_location" { + description = "The location of Azure service provider(resource)" + type = string +} +variable "azure_service_key_name" { + description = "Azure Service Key Name" + type = string +} +variable "azure_service_provider_name" { + description = "The name of Azure Service Provider" + type = string + default = "" +} +variable "azure_peering_location" { + description = "The name of the peering location (not the Azure resource location)" + type = string + default = "" +} +variable "azure_tier" { + description = "The Service tier. Possible values are Basic, Local, Standard or Premium" + type = string +} +variable "azure_family" { + description = "The billing mode for bandwidth. Possible values are MeteredData or UnlimitedData" + type = string +} +variable "azure_environment" { + description = "The Cloud environment which should be used for Service Key" + type = string +} ``` outputs.tf: - ```hcl +```hcl + output "azure_connection_id" { value = module.create_port_2_azure_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { client_id = var.equinix_client_id client_secret = var.equinix_client_secret } - +provider "azurerm" { + features {} + client_id = var.azure_client_id + client_secret = var.azure_client_secret + tenant_id = var.azure_tenant_id + subscription_id = var.azure_subscription_id + + skip_provider_registration = true +} +resource "azurerm_resource_group" "port2azure" { + name = var.azure_resource_name + location = var.azure_location +} +resource "azurerm_express_route_circuit" "port2azure" { + name = var.azure_service_key_name + resource_group_name = azurerm_resource_group.port2azure.name + location = azurerm_resource_group.port2azure.location + service_provider_name = var.azure_service_provider_name + peering_location = var.azure_peering_location + bandwidth_in_mbps = var.bandwidth + sku { + tier = var.azure_tier + family = var.azure_family + } + allow_classic_operations = false + tags = { + environment = var.azure_environment + } +} module "create_port_2_azure_connection" { source = "equinix/fabric/equinix//modules/port-connection" @@ -158,7 +258,7 @@ module "create_port_2_azure_connection" { connection_type = var.connection_type notifications_type = var.notifications_type notifications_emails = var.notifications_emails - bandwidth = var.bandwidth + bandwidth = azurerm_express_route_circuit.port2azure.bandwidth_in_mbps purchase_order_number = var.purchase_order_number # A-side @@ -168,13 +268,14 @@ module "create_port_2_azure_connection" { # Z-side zside_ap_type = var.zside_ap_type - zside_ap_authentication_key = var.zside_ap_authentication_key + zside_peering_type = var.zside_peering_type + zside_ap_authentication_key = azurerm_express_route_circuit.port2azure.service_key zside_ap_profile_type = var.zside_ap_profile_type zside_location = var.zside_location zside_sp_name = var.zside_sp_name } ``` - + ## Requirements @@ -241,4 +342,4 @@ module "create_port_2_azure_connection" { | Name | Description | |------|-------------| | [azure\_connection\_id](#output\_azure\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-azure-redundant-connections/README.md b/examples/port-2-azure-redundant-connections/README.md index 1a2e67ef..85ae0568 100644 --- a/examples/port-2-azure-redundant-connections/README.md +++ b/examples/port-2-azure-redundant-connections/README.md @@ -1,3 +1,16 @@ +# Fabric Port to Fabric Azure Service Profile Redundant Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Azure Service Profile with two connections. A primary +and secondary connection. + +It leverages the Equinix Terraform Provider, the Azure Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +41,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -49,10 +63,22 @@ zside_ap_authentication_key = "" zside_ap_profile_type = "L2_PROFILE" zside_location = "SV" zside_sp_name = "Azure ExpressRoute" - +zside_peering_type = "PRIVATE" +azure_client_id = "" +azure_client_secret = "" +azure_tenant_id = "" +azure_subscription_id = "" +azure_location = "West US 2" +azure_service_key_name = "Test_Azure_Key" +azure_service_provider_name = "" +azure_peering_location = "Silicon Valley Test" +azure_tier = "Standard" +azure_family = "UnlimitedData" +azure_environment = "PROD" ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -60,12 +86,16 @@ terraform { source = "equinix/equinix" version = ">= 1.20.0" } + azurerm = { + source = "hashicorp/azurerm" + version = "3.84.0" + } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -74,12 +104,10 @@ variable "equinix_client_secret" { description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" type = string } - variable "connection_name" { description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores" type = string } - variable "secondary_connection_name" { description = "Secondary Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores" type = string @@ -101,7 +129,6 @@ variable "bandwidth" { description = "Connection bandwidth in Mbps" type = number } - variable "secondary_bandwidth" { description = "Secondary Connection bandwidth in Mbps" type = number @@ -111,18 +138,14 @@ variable "purchase_order_number" { type = string default = "" } - variable "aside_port_name" { description = "Equinix A-Side Port Name" type = string } - - variable "aside_secondary_port_name" { description = "Secondary Equinix A-Side Port Name" type = string } - variable "aside_vlan_tag" { description = "Vlan Tag information, outer vlanSTag for QINQ connections" type = string @@ -136,10 +159,6 @@ 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 -} variable "zside_ap_profile_type" { description = "Service profile type - L2_PROFILE, L3_PROFILE, ECIA_PROFILE, ECMC_PROFILE" type = string @@ -152,10 +171,64 @@ variable "zside_sp_name" { description = "Equinix Service Profile Name" type = string } +variable "zside_peering_type" { + description = "Zside Access Point Peering type. Available values; PRIVATE, MICROSOFT, PUBLIC, MANUAL" + type = string +} +variable "azure_client_id" { + description = "Azure Client id" + type = string +} +variable "azure_client_secret" { + description = "Azure Secret value" + type = string +} +variable "azure_tenant_id" { + description = "Azure Tenant id" + type = string +} +variable "azure_subscription_id" { + description = "Azure Subscription id" + type = string +} +variable "azure_resource_name" { + description = "The name of Azure Resource" + type = string +} +variable "azure_location" { + description = "The location of Azure service provider(resource)" + type = string +} +variable "azure_service_key_name" { + description = "Azure Service Key" + type = string +} +variable "azure_service_provider_name" { + description = "The name of Azure Service Provider" + type = string + default = "" +} +variable "azure_peering_location" { + description = "The name of the peering location (not the Azure resource location)" + type = string + default = "" +} +variable "azure_tier" { + description = "The Service tier. Possible values are Basic, Local, Standard or Premium" + type = string +} +variable "azure_family" { + description = "The billing mode for bandwidth. Possible values are MeteredData or UnlimitedData" + type = string +} +variable "azure_environment" { + description = "The Cloud environment which should be used for Service Key" +} ``` outputs.tf: - ```hcl +```hcl + output "azure_primary_connection_id" { value = module.create_port_2_azure_connections.primary_connection_id } @@ -163,17 +236,43 @@ output "azure_primary_connection_id" { output "azure_secondary_connection_id" { value = module.create_port_2_azure_connections.secondary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { client_id = var.equinix_client_id client_secret = var.equinix_client_secret } - +provider "azurerm" { + features {} + client_id = var.azure_client_id + client_secret = var.azure_client_secret + tenant_id = var.azure_tenant_id + subscription_id = var.azure_subscription_id + + skip_provider_registration = true +} +resource "azurerm_resource_group" "port2azure" { + name = var.azure_resource_name + location = var.azure_location +} +resource "azurerm_express_route_circuit" "port2azure" { + name = var.azure_service_key_name + resource_group_name = azurerm_resource_group.port2azure.name + location = azurerm_resource_group.port2azure.location + service_provider_name = var.azure_service_provider_name + peering_location = var.azure_peering_location + bandwidth_in_mbps = var.bandwidth + sku { + tier = var.azure_tier + family = var.azure_family + } + allow_classic_operations = false + tags = { + environment = var.azure_environment + } +} module "create_port_2_azure_connections" { source = "equinix/fabric/equinix//modules/port-connection" @@ -182,12 +281,12 @@ module "create_port_2_azure_connections" { connection_type = var.connection_type notifications_type = var.notifications_type notifications_emails = var.notifications_emails - bandwidth = var.bandwidth + bandwidth = azurerm_express_route_circuit.port2azure.bandwidth_in_mbps purchase_order_number = var.purchase_order_number # Secondary Connection Overrides secondary_connection_name = var.secondary_connection_name - secondary_bandwidth = var.secondary_bandwidth + secondary_bandwidth = azurerm_express_route_circuit.port2azure.bandwidth_in_mbps # Primary A-side aside_port_name = var.aside_port_name @@ -199,13 +298,14 @@ module "create_port_2_azure_connections" { # Z-side zside_ap_type = var.zside_ap_type - zside_ap_authentication_key = var.zside_ap_authentication_key + zside_ap_authentication_key = azurerm_express_route_circuit.port2azure.service_key zside_ap_profile_type = var.zside_ap_profile_type zside_location = var.zside_location zside_sp_name = var.zside_sp_name + zside_peering_type = var.zside_peering_type } ``` - + ## Requirements @@ -276,4 +376,4 @@ module "create_port_2_azure_connections" { |------|-------------| | [azure\_primary\_connection\_id](#output\_azure\_primary\_connection\_id) | n/a | | [azure\_secondary\_connection\_id](#output\_azure\_secondary\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-google-connection/README.md b/examples/port-2-google-connection/README.md index c2d705be..8ee6de5b 100644 --- a/examples/port-2-google-connection/README.md +++ b/examples/port-2-google-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric Google Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Google Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -47,10 +60,10 @@ zside_ap_profile_type = "L2_PROFILE" zside_location = "SV" zside_seller_region = "us-west1" zside_sp_name = "Google Cloud Partner Interconnect Zone 2" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -60,10 +73,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -138,17 +151,15 @@ variable "zside_seller_region" { description = "Access point seller region" type = string } - ``` outputs.tf: - ```hcl +```hcl + output "google_connection_id" { value = module.create_port_2_google_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -180,7 +191,7 @@ module "create_port_2_google_connection" { zside_sp_name = var.zside_sp_name } ``` - + ## Requirements @@ -230,4 +241,4 @@ No resources. | Name | Description | |------|-------------| | [google\_connection\_id](#output\_google\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-ibm1-connection/README.md b/examples/port-2-ibm1-connection/README.md index e782fc94..05fb92c0 100644 --- a/examples/port-2-ibm1-connection/README.md +++ b/examples/port-2-ibm1-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric IBM 1.0 Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric IBM 1.0 Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixClientSecret" @@ -48,10 +61,10 @@ zside_location = "SV" zside_sp_name = "IBM Cloud Direct Link Exchange" zside_seller_region = "San Jose 2" additional_info = [{ key = "ASN", value = "14353" }] - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -61,10 +74,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -144,17 +157,15 @@ variable "additional_info" { type = list(object({ key = string, value = string })) default = [] } - ``` outputs.tf: - ```hcl +```hcl + output "ibm1_connection_id" { value = module.create_port_2_ibm1_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -187,7 +198,7 @@ module "create_port_2_ibm1_connection" { primary_additional_info = var.additional_info } ``` - + ## Requirements @@ -238,4 +249,4 @@ No resources. | Name | Description | |------|-------------| | [ibm1\_connection\_id](#output\_ibm1\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-ibm2-connection/README.md b/examples/port-2-ibm2-connection/README.md index 64c48460..df9938f9 100644 --- a/examples/port-2-ibm2-connection/README.md +++ b/examples/port-2-ibm2-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric IBM 2.0 Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric IBM 2.0 Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixClientSecret" @@ -48,10 +61,10 @@ zside_location = "SV" zside_sp_name = "IBM Cloud Direct Link 2" zside_seller_region = "San Jose 2" additional_info = [{ key = "ASN", value = "14353" }] - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -61,10 +74,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -144,17 +157,15 @@ variable "additional_info" { type = list(object({ key = string, value = string })) default = [] } - ``` outputs.tf: - ```hcl +```hcl + output "ibm2_connection_id" { value = module.create_port_2_ibm2_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -187,7 +198,7 @@ module "create_port_2_ibm2_connection" { primary_additional_info = var.additional_info } ``` - + ## Requirements @@ -238,4 +249,4 @@ No resources. | Name | Description | |------|-------------| | [ibm2\_connection\_id](#output\_ibm2\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-oracle-connection/README.md b/examples/port-2-oracle-connection/README.md index afbc826f..2df5d372 100644 --- a/examples/port-2-oracle-connection/README.md +++ b/examples/port-2-oracle-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric Oracle Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Oracle Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -47,10 +60,10 @@ zside_ap_profile_type = "L2_PROFILE" zside_location = "DC" zside_sp_name = "Oracle Cloud Infrastructure -OCI- FastConnect" zside_seller_region = "us-ashburn-1" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -60,10 +73,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -138,17 +151,15 @@ variable "zside_seller_region" { description = "Access point seller region" type = string } - ``` outputs.tf: - ```hcl +```hcl + output "oracle_connection_id" { value = module.create_port_2_oracle_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -179,7 +190,7 @@ module "create_port_2_oracle_connection" { zside_sp_name = var.zside_sp_name } ``` - + ## Requirements @@ -229,4 +240,4 @@ No resources. | Name | Description | |------|-------------| | [oracle\_connection\_id](#output\_oracle\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-port-connection/README.md b/examples/port-2-port-connection/README.md index 51f8d55a..ce14e884 100644 --- a/examples/port-2-port-connection/README.md +++ b/examples/port-2-port-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric Port Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Port. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -44,10 +57,10 @@ zside_ap_type = "COLO" zside_port_name = "ops-user100-CX-SV1-NL-Qinq-STD-1G-PRI-NK-349" zside_vlan_tag = "3711" zside_location = "SV" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -57,10 +70,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -127,17 +140,15 @@ variable "zside_vlan_tag" { description = "Vlan Tag information, outer vlanSTag for QINQ connections" type = string } - ``` outputs.tf: - ```hcl +```hcl + output "port_connection_id" { value = module.create_port_2_port_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -166,7 +177,7 @@ module "create_port_2_port_connection" { zside_location = var.zside_location } ``` - + ## Requirements @@ -214,4 +225,4 @@ No resources. | Name | Description | |------|-------------| | [port\_connection\_id](#output\_port\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-private-service-profile-connection/README.md b/examples/port-2-private-service-profile-connection/README.md index 764b3b5b..72655ba5 100644 --- a/examples/port-2-private-service-profile-connection/README.md +++ b/examples/port-2-private-service-profile-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric Private Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Private Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -44,10 +57,10 @@ zside_ap_type = "SP" zside_ap_profile_type = "L2_PROFILE" zside_location = "DA" zside_sp_name = "Equinix Direct Connect - Private" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -57,10 +70,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -127,17 +140,15 @@ variable "zside_sp_name" { description = "Equinix Service Profile Name" type = string } - ``` outputs.tf: - ```hcl +```hcl + output "private_sp_connection_id" { value = module.create_port_2_private_sp_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -166,7 +177,7 @@ module "create_port_2_private_sp_connection" { zside_sp_name = var.zside_sp_name } ``` - + ## Requirements @@ -214,4 +225,4 @@ No resources. | Name | Description | |------|-------------| | [private\_sp\_connection\_id](#output\_private\_sp\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/port-2-public-service-profile-connection/README.md b/examples/port-2-public-service-profile-connection/README.md index b00d409d..a978aec1 100644 --- a/examples/port-2-public-service-profile-connection/README.md +++ b/examples/port-2-public-service-profile-connection/README.md @@ -1,3 +1,15 @@ +# Fabric Port to Fabric Public Service Profile Connection + +This example shows how to leverage the [Fabric Port Connection Module](../../modules/port-connection/README.md) +to create a Fabric Connection from a Fabric Port to Fabric Public Service Profile. + +It leverages the Equinix Terraform Provider, and the Fabric Port Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "MyEquinixClientId" equinix_client_secret = "MyEquinixSecret" @@ -44,10 +57,10 @@ zside_ap_type = "SP" zside_ap_profile_type = "L2_PROFILE" zside_location = "SV" zside_sp_name = "AMCRH-Gen-SP" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -57,10 +70,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -127,17 +140,15 @@ variable "zside_sp_name" { description = "Equinix Service Profile Name" type = string } - ``` outputs.tf: - ```hcl +```hcl + output "public_sp_connection_id" { value = module.create_port_2_public_sp_connection.primary_connection_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -166,7 +177,7 @@ module "create_port_2_public_sp_connection" { zside_sp_name = var.zside_sp_name } ``` - + ## Requirements @@ -214,4 +225,4 @@ No resources. | Name | Description | |------|-------------| | [public\_sp\_connection\_id](#output\_public\_sp\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/examples/routing-protocols/README.md b/examples/routing-protocols/README.md index 89067a03..326d7f8d 100644 --- a/examples/routing-protocols/README.md +++ b/examples/routing-protocols/README.md @@ -1,3 +1,15 @@ +# Fabric Routing Protocols Addition to Fabric Connection + +This example shows how to leverage the [Fabric Routing Protocols Module](../../modules/routing-protocols/README.md) +to create Routing Protocols for a Fabric Connection. + +It leverages the Equinix Terraform Provider, and the Fabric Routing Protocols +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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 @@ -28,7 +40,8 @@ To use this example of the module in your own terraform configuration include th *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 +```hcl + equinix_client_id = "" equinix_client_secret = "" @@ -44,10 +57,10 @@ bgp_customer_peer_ipv6 = "190::1:2" bgp_enabled_ipv4 = true bgp_enabled_ipv6 = true bgp_customer_asn = "100" - ``` versions.tf: - ```hcl +```hcl + terraform { required_version = ">= 1.5.4" required_providers { @@ -57,10 +70,10 @@ terraform { } } } - ``` variables.tf: - ```hcl +```hcl + variable "equinix_client_id" { description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" type = string @@ -118,10 +131,10 @@ variable "bgp_customer_asn" { type = string default = "" } - ``` outputs.tf: - ```hcl +```hcl + output "direct_rp_id" { value = module.routing_protocols.direct_routing_protocol_id } @@ -129,10 +142,8 @@ output "direct_rp_id" { output "bgp_rp_id" { value = module.routing_protocols.bgp_routing_protocol_id } - ``` main.tf: - ```hcl provider "equinix" { @@ -159,7 +170,7 @@ module "routing_protocols" { bgp_enabled_ipv6 = var.bgp_enabled_ipv6 } ``` - + ## Requirements @@ -205,4 +216,4 @@ No resources. |------|-------------| | [bgp\_rp\_id](#output\_bgp\_rp\_id) | n/a | | [direct\_rp\_id](#output\_direct\_rp\_id) | n/a | - \ No newline at end of file + diff --git a/examples/service-token-metal-2-fabric-aws-connection/README.md b/examples/service-token-metal-2-fabric-aws-connection/README.md new file mode 100644 index 00000000..b5f85dc2 --- /dev/null +++ b/examples/service-token-metal-2-fabric-aws-connection/README.md @@ -0,0 +1,331 @@ +# Fabric Service Token - Equinix Metal to Fabric AWS Service Profile Connection + +This example shows how to leverage the [Fabric Service Token Connection Module](../../modules/service-token-connection/README.md) +to create a Fabric Connection from Equinix Metal to Fabric AWS Service Profile. + +It leverages the Equinix Terraform Provider, the AWS Terraform Provider, and the Fabric Service Token Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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-metal-2-fabric-aws-connection +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" + +metal_auth_token = "" +metal_connection_speed_unit = "MB" +metal_connection_metro = "SV" +metal_project_id = "" +metal_connection_description = "Connect from Equinix Metal to Service provider using a-side token" + +connection_speed = 50 +connection_name = "metal-2-fabric" +connection_type = "EVPL_VC" +notifications_type = "ALL" +notifications_emails = ["example@equinix.com"] +bandwidth = 50 +purchase_order_number = "1-323292" +zside_ap_type = "SP" +zside_ap_authentication_key = "" +zside_ap_profile_type = "L2_PROFILE" +zside_location = "SV" +zside_sp_name = "AWS Direct Connect" +zside_seller_region = "us-west-1" +additional_info = [ + { key = "accessKey", value = "" }, + { key = "secretKey", value = "" } +] +``` +versions.tf: +```hcl + +terraform { + required_version = ">= 1.5.2" + required_providers { + equinix = { + source = "equinix/equinix" + version = ">= 1.20.0" + } + } +} +``` +variables.tf: +```hcl + +variable "equinix_client_id" { + description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" + type = string +} +variable "equinix_client_secret" { + description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" + type = string +} +variable "metal_auth_token" { + description = "Equinix Metal Authentication API Token" + type = string +} +variable "metal_connection_speed_unit" { + description = "Unit of the speed/bandwidth to be allocated to the connection" + type = string + default = "MB" +} +variable "metal_connection_metro" { + description = "Metro where the connection will be created" + type = string +} +variable "metal_project_id" { + description = "Metal Project Name" + type = string +} +variable "metal_connection_description" { + description = "Description for the connection resource" + type = string + default = "Connect from Equinix Metal to Service provider using a-side token" +} +variable "connection_speed" { + description = "Speed/Bandwidth to be allocated to the connection - (MB or GB)" + type = number + default = 50 +} +variable "connection_name" { + description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores" + type = string +} +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 "zside_ap_type" { + description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW" + type = string + default = "" +} +variable "zside_ap_authentication_key" { + description = "Authentication key for provider based connections" + type = string +} +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 + default = "" +} +variable "zside_sp_name" { + description = "Equinix Service Profile Name" + type = string +} +variable "zside_seller_region" { + description = "Access point seller region" + type = string +} +variable "additional_info" { + description = "Additional info parameters. It's a list of maps containing 'key' and 'value' keys with their corresponding values." + type = list(object({ key = string, value = string })) + default = [] +} +``` +outputs.tf: +```hcl + +output "metal-connection" { + value = equinix_metal_connection.metal-connection.id +} + +output "fabric-connection" { + value = module.metal-2-fabric-connection.primary_connection_id +} +``` +main.tf: +```hcl + +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret + auth_token = var.metal_auth_token // added +} +resource "random_string" "random" { + length = 3 + special = false +} +locals { + connection_name = format("%s-%s", var.connection_name, random_string.random.result) + metal_speed_unit = var.metal_connection_speed_unit == "GB" ? "Gbps" : "Mbps" +} +resource "equinix_metal_device" "s1" { + hostname = "tf-rocky9-server-${var.metal_connection_metro}-1" + plan = "m3.small.x86" + metro = lower(var.metal_connection_metro) + operating_system = "rocky_9" + billing_cycle = "hourly" + project_id = var.metal_project_id +} +resource "equinix_metal_vlan" "vlan-server-1" { + description = "${var.metal_connection_metro} VLAN Server 1 to Cloud" + metro = lower(var.metal_connection_metro) + project_id = var.metal_project_id +} +resource "equinix_metal_device_network_type" "s1-network-type" { + device_id = equinix_metal_device.s1.id + type = "hybrid" +} +resource "equinix_metal_port_vlan_attachment" "s1-attachment" { + device_id = equinix_metal_device_network_type.s1-network-type.id + port_name = "bond0" + vlan_vnid = equinix_metal_vlan.vlan-server-1.vxlan +} +resource "equinix_metal_connection" "metal-connection" { + name = local.connection_name + project_id = var.metal_project_id + metro = var.metal_connection_metro + redundancy = "primary" + type = "shared" + service_token_type = "a_side" + description = var.metal_connection_description + tags = ["terraform"] + speed = format("%d%s", var.connection_speed, local.metal_speed_unit) + vlans = [equinix_metal_vlan.vlan-server-1.vxlan] // required for shared connection + contact_email = "srpatel@equinix.com" +} +module "metal-2-fabric-connection" { + source = "equinix/fabric/equinix//modules/service-token-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 + additional_info = var.additional_info + + #A-Side + aside_service_token_uuid = equinix_metal_connection.metal-connection.service_tokens.0.id + + #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 +} +``` + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.5.2 | +| [equinix](#requirement\_equinix) | >= 1.20.0 | + +## Providers + +| Name | Version | +|------|---------| +| [equinix](#provider\_equinix) | >= 1.20.0 | +| [random](#provider\_random) | n/a | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [metal-2-fabric-connection](#module\_metal-2-fabric-connection) | ../../modules/service-token-connection | n/a | + +## Resources + +| Name | Type | +|------|------| +| [equinix_metal_connection.metal-connection](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_connection) | resource | +| [equinix_metal_device.s1](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_device) | resource | +| [equinix_metal_device_network_type.s1-network-type](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_device_network_type) | resource | +| [equinix_metal_port_vlan_attachment.s1-attachment](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_port_vlan_attachment) | resource | +| [equinix_metal_vlan.vlan-server-1](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/metal_vlan) | resource | +| [random_string.random](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [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 | +| [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 | +| [metal\_auth\_token](#input\_metal\_auth\_token) | Equinix Metal Authentication API Token | `string` | n/a | yes | +| [metal\_connection\_metro](#input\_metal\_connection\_metro) | Metro where the connection will be created | `string` | n/a | yes | +| [metal\_project\_id](#input\_metal\_project\_id) | Metal Project Name | `string` | n/a | yes | +| [notifications\_emails](#input\_notifications\_emails) | Array of contact emails | `list(string)` | n/a | yes | +| [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\_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 | +| [additional\_info](#input\_additional\_info) | Additional info parameters. It's a list of maps containing 'key' and 'value' keys with their corresponding values. | `list(object({ key = string, value = string }))` | `[]` | no | +| [connection\_speed](#input\_connection\_speed) | Speed/Bandwidth to be allocated to the connection - (MB or GB) | `number` | `50` | no | +| [metal\_connection\_description](#input\_metal\_connection\_description) | Description for the connection resource | `string` | `"Connect from Equinix Metal to Service provider using a-side token"` | no | +| [metal\_connection\_speed\_unit](#input\_metal\_connection\_speed\_unit) | Unit of the speed/bandwidth to be allocated to the connection | `string` | `"MB"` | no | +| [notifications\_type](#input\_notifications\_type) | Notification Type - ALL is the only type currently supported | `string` | `"ALL"` | no | +| [purchase\_order\_number](#input\_purchase\_order\_number) | Purchase order number | `string` | `""` | no | +| [zside\_ap\_type](#input\_zside\_ap\_type) | Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW | `string` | `""` | no | +| [zside\_location](#input\_zside\_location) | Access point metro code | `string` | `""` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [fabric-connection](#output\_fabric-connection) | n/a | +| [metal-connection](#output\_metal-connection) | n/a | + diff --git a/examples/metal-2-fabric-aws-connection/main.tf b/examples/service-token-metal-2-fabric-aws-connection/main.tf similarity index 100% rename from examples/metal-2-fabric-aws-connection/main.tf rename to examples/service-token-metal-2-fabric-aws-connection/main.tf diff --git a/examples/metal-2-fabric-aws-connection/outputs.tf b/examples/service-token-metal-2-fabric-aws-connection/outputs.tf similarity index 100% rename from examples/metal-2-fabric-aws-connection/outputs.tf rename to examples/service-token-metal-2-fabric-aws-connection/outputs.tf diff --git a/examples/metal-2-fabric-aws-connection/terraform.tfvars.example b/examples/service-token-metal-2-fabric-aws-connection/terraform.tfvars.example similarity index 100% rename from examples/metal-2-fabric-aws-connection/terraform.tfvars.example rename to examples/service-token-metal-2-fabric-aws-connection/terraform.tfvars.example diff --git a/examples/metal-2-fabric-aws-connection/variables.tf b/examples/service-token-metal-2-fabric-aws-connection/variables.tf similarity index 100% rename from examples/metal-2-fabric-aws-connection/variables.tf rename to examples/service-token-metal-2-fabric-aws-connection/variables.tf diff --git a/examples/metal-2-fabric-aws-connection/versions.tf b/examples/service-token-metal-2-fabric-aws-connection/versions.tf similarity index 100% rename from examples/metal-2-fabric-aws-connection/versions.tf rename to examples/service-token-metal-2-fabric-aws-connection/versions.tf diff --git a/examples/virtual-device-2-azure-connection/README.md b/examples/virtual-device-2-azure-connection/README.md index e69de29b..e66d47f5 100644 --- a/examples/virtual-device-2-azure-connection/README.md +++ b/examples/virtual-device-2-azure-connection/README.md @@ -0,0 +1,452 @@ +# Fabric Virtual Device to Fabric Azure Service Profile Connection + +This example shows how to leverage the [Fabric Virtual Device Connection Module](../../modules/virtual-device-connection/README.md) +to create a Fabric Connection from a Fabric Virtual Device to Fabric Azure Service Profile. + +It leverages the Equinix Terraform Provider, the Azure Terraform Provider, and the Fabric Virtual Device Connection +Module to setup the connection based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +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/virtual-device-2-azure-connection +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" +equinix_endpoint = "endpointURL" + +#NE Acl Template +template_name = "test-wan-acl-template" +template_description = "WAN ACL template" +template_subnet = "172.16.25.0/24" +template_protocol = "TCP" +template_src_port = "any" +template_dst_port = "22" + +#Network Edge +ne_name = "Terra_Test_router" +ne_metro_code = "SV" +ne_type_code = "C8000V" +ne_package_code = "network-essentials" +ne_notifications = ["test@eq.com"] +ne_hostname = "C8KV" +ne_account_number = "182390403" +ne_version = "17.11.01a" +ne_core_count = 2 +ne_term_length = 1 + +ne_ssh_key_username = "" +ne_ssh_key_name = " diff --git a/modules/cloud-router-connection/README.md b/modules/cloud-router-connection/README.md index 13002ff1..b5af4014 100644 --- a/modules/cloud-router-connection/README.md +++ b/modules/cloud-router-connection/README.md @@ -1,9 +1,20 @@ +# Fabric Cloud Router Connection SubModule + +The Fabric Cloud Router Connection SubModule will create a connection from a Fabric Cloud Router to the following Z-Side +Access Points based on provided variable configuration: +1. Fabric Service Profile - SP Access Point Type +2. Fabric Port - COLO Access Point Type +3. Fabric Network - NETWORK Access Point Type + +Please refer to the cloud-router-* examples in this module's registry for more details on how to leverage the submodule. + + ## 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) - + ## Requirements diff --git a/modules/port-connection/README.md b/modules/port-connection/README.md index db738768..2e4e7f4e 100644 --- a/modules/port-connection/README.md +++ b/modules/port-connection/README.md @@ -1,9 +1,19 @@ +# Fabric Port Connection SubModule + +The Fabric Port Connection Module will create a connection from a Fabric Port to the following Z-Side +Access Points based on provided variable configuration: +1. Fabric Service Profile - SP Access Point Type +2. Fabric Port - COLO Access Point Type + +Please refer to the port-* examples in this module's registry for more details on how to leverage the submodule. + + ## 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) - + ## Requirements diff --git a/modules/routing-protocols/README.md b/modules/routing-protocols/README.md index 5513a0e2..4e4d4160 100644 --- a/modules/routing-protocols/README.md +++ b/modules/routing-protocols/README.md @@ -1,3 +1,17 @@ +# Fabric Routing Protocols SubModule + +The Fabric Routing Protocols Module will add Direct (and BGP if specified) Routing Protocol details to an +existing Fabric Connection. + +Please refer to the routing-protocols example in this module's registry for more details on how to leverage the submodule. + + +## 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) + ## Requirements @@ -44,4 +58,4 @@ No modules. |------|-------------| | [bgp\_routing\_protocol\_id](#output\_bgp\_routing\_protocol\_id) | n/a | | [direct\_routing\_protocol\_id](#output\_direct\_routing\_protocol\_id) | n/a | - \ No newline at end of file + diff --git a/modules/service-token-connection/README.md b/modules/service-token-connection/README.md index f1a16b7d..5fc614af 100644 --- a/modules/service-token-connection/README.md +++ b/modules/service-token-connection/README.md @@ -1,3 +1,20 @@ +# Fabric Service Token Connection SubModule + +The Fabric Service Token Connection Module will create a connection from a Fabric Service Token to the following Z-Side +Access Points based on provided variable configuration: +1. Fabric Service Profile - SP Access Point Type +2. Fabric Port - COLO Access Point Type +3. Fabric Service Token - Service Token is provided instead of Z-Side Access Point + +Please refer to the service-token-* examples in this module's registry for more details on how to leverage the submodule. + + +## 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) + ## Requirements @@ -53,4 +70,4 @@ No modules. | Name | Description | |------|-------------| | [primary\_connection\_id](#output\_primary\_connection\_id) | n/a | - \ No newline at end of file + diff --git a/modules/virtual-device-connection/README.md b/modules/virtual-device-connection/README.md index e69de29b..8d3e031c 100644 --- a/modules/virtual-device-connection/README.md +++ b/modules/virtual-device-connection/README.md @@ -0,0 +1,17 @@ +# Fabric Virtual Device Connection SubModule + +The Fabric Virtual Device Connection Module will create a connection from a Fabric Virtual Device to the following +Z-Side Access Points based on provided variable configuration: +1. Fabric Service Profile - SP Access Point Type +2. Fabric Port - COLO Access Point Type +3. Fabric Service Token - Service Token is provided instead of Z-Side Access Point + +Please refer to the virtual-device-* examples in this module's registry for more details on how to leverage the submodule. + + +## 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) +