Skip to content

Commit

Permalink
Add redundant connection to Port2Azure and update variables+README.md…
Browse files Browse the repository at this point in the history
… for both single and redundant Port2Azure Examples
  • Loading branch information
thogarty committed Sep 29, 2023
1 parent 97e8ea6 commit 46166d2
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

This example shows how to create layer 2 connection between ECX Fabric port
and AZURE Cloud.
Example covers **provisioning of both sides** of the connection.

## Adjust variables

Expand All @@ -13,30 +12,30 @@ At minimum, you must set below variables in `terraform.tfvars` file:
* `equinix_client_secret` - Equinix client secret ID (consumer secret),
obtained same way as above

`fabric_sp_name` - Service profile name like i.e. AZURE
`equinix_port_name` - Name of ECX Fabric port that should be
connected to AZURE, i.e. ops-user100-CX-SV5-NL-Qinq-BO-10G-SEC-JP-199
`connection_name` - the name of the connection
`connection_type` - connection type, please refer schema
`notifications_type` - notification type
`connection_name` - The name of the connection
`connection_type` - Connection type, please refer to OAS schema for enum values.
`notifications_type` - Notification type
`notifications_emails` - List of emails
`bandwidth` - bandwidth in MBs
`redundancy` - Port redundancy
`bandwidth` - Bandwidth in MBs
`redundancy` - Port redundancy PRIMARY or SECONDARY
`purchase_order_number` - Purchase order number applied to billing invoices for this connection.
`aside_ap_type` - Access point type
`peering_type` - Peering type
`aside_port_uuid` - Port uuid, fetched based on port call using Port resource
`aside_link_protocol_type` - link protocol type
`aside_link_protocol_stag` - s tag number
`aside_link_protocol_ctag` - c tag number
`aside_link_protocol_type` - Link protocol type
`aside_link_protocol_stag` - S-Tag number
`zside_ap_type` - Z side access point type
`zside_ap_authentication_key` - AZURE authorization key, like c620477c-3f30-41e8-a0b9-cfdb4a12121d
`zside_ap_authentication_key` - AZURE authorization key, like c620477c-3f30-41e8-a0b9-cf324a12121d
`zside_ap_profile_type` - Service profile type
`zside_ap_profile_uuid` - Service profile uuid, fetched based on Service Profile get call using Service Profile search schema
`zside_location` - Seller location
`zside_location` - Equinix Metro Code for the Z side access point
`fabric_sp_name` - Service profile name like i.e. AZURE
`equinix_port_name` - Name of ECX Fabric port that will be used for the Connection

## Azure login

Log in to Azure portal use account that has permission to create necessary resources.
Log in to Azure portal with an account that has permission to create necessary resources.

Create an Azure ExpressRoute Circuit and use its Service Key as the Authentication Key in the examples.

Bandwidth in Terraform must match the bandwidth of the ExpressRoute Circuit created in Azure.

## Initialize

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data "equinix_fabric_service_profiles" "azure" {
filter {
property = "/name"
operator = "="
values = [var.fabric_sp_name]
values = [var.fabric_sp_name]
}
}

Expand All @@ -20,38 +20,37 @@ data "equinix_fabric_ports" "qinq-pri" {
resource "equinix_fabric_connection" "azure-qinq" {
name = var.connection_name
type = var.connection_type
notifications{
type=var.notifications_type
emails=var.notifications_emails
notifications {
type = var.notifications_type
emails = var.notifications_emails
}
bandwidth = var.bandwidth
redundancy {priority= var.redundancy}
redundancy { priority = var.redundancy }
order {
purchase_order_number= var.purchase_order_number
purchase_order_number = var.purchase_order_number
}
a_side {
access_point {
type= var.aside_ap_type
type = var.aside_ap_type
port {
uuid= data.equinix_fabric_ports.qinq-pri.data.0.uuid
uuid = data.equinix_fabric_ports.qinq-pri.data.0.uuid
}
link_protocol {
type= var.aside_link_protocol_type
vlan_s_tag= var.aside_link_protocol_stag
type = var.aside_link_protocol_type
vlan_s_tag = var.aside_link_protocol_stag
}
}
}
z_side {
access_point {
type= var.zside_ap_type
authentication_key= var.zside_ap_authentication_key
///peering_type= var.peering_type
type = var.zside_ap_type
authentication_key = var.zside_ap_authentication_key
profile {
type= var.zside_ap_profile_type
uuid= data.equinix_fabric_service_profiles.azure.data.0.uuid
type = var.zside_ap_profile_type
uuid = data.equinix_fabric_service_profiles.azure.data.0.uuid
}
location {
metro_code= var.zside_location
metro_code = var.zside_location
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
equinix_client_id = "MyEquinixClientId"
equinix_client_secret = "MyEquinixSecret"

connection_name = "terra_e2e_azure"
connection_name = "Terra_Port2Azure"
connection_type = "EVPL_VC"
notifications_type = "ALL"
notifications_emails = ["[email protected]"]
bandwidth = 50
redundancy = "PRIMARY"
purchase_order_number = "1-323292"
aside_ap_type = "COLO"
peering_type="MICROSOFT"
aside_port_uuid = "c4d9350e-783c-83cd-1ce0-306a5c00a600"
aside_link_protocol_type = "QINQ"
aside_link_protocol_stag = "2019"
zside_ap_type = "SP"
zside_ap_authentication_key = "c620477c-3f30-41e8-a0b9-cfdb4a31034b"
zside_ap_authentication_key = "Azure Express Route Service Key"
zside_ap_profile_type = "L2_PROFILE"
zside_ap_profile_uuid = "bfb74121-7e2c-4f74-99b3-69cdafb03b41"
zside_location = "SV"
fabric_sp_name = "Azure ExpressRoute"
equinix_port_name = "ops-user100-CX-SV1-NL-Qinq-STD-1G-PRI-NK-349"
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ variable "bandwidth" {}
variable "redundancy" {}
variable "purchase_order_number" {}
variable "aside_ap_type" {}
variable "aside_port_uuid" {}
variable "aside_link_protocol_type" {}
variable "aside_link_protocol_stag" {}
variable "zside_ap_type" {}
variable "zside_ap_authentication_key" {}
variable "peering_type" {}
variable "zside_ap_profile_type" {}
variable "zside_ap_profile_uuid" {}
variable "zside_location" {}
variable "fabric_sp_name" {}
variable "equinix_port_name" {}
variable "equinix_port_name" {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ECX Fabric Layer2 Redundant Connection to Azure

This example shows how to create Layer 2 Connection between two ECX Fabric ports
and AZURE Cloud.

## Adjust variables

At minimum, you must set below variables in `terraform.tfvars` file:

* `equinix_client_id` - Equinix client ID (consumer key), obtained after
registering app in the developer platform
* `equinix_client_secret` - Equinix client secret ID (consumer secret),
obtained same way as above

`pri_connection_name` - The name of the PRIMARY connection
`sec_connection_name` - The name of the SECONDARY connection
`connection_type` - Connection type, please refer to OAS schema for enum values.
`notifications_type` - Notification type
`notifications_emails` - List of emails
`bandwidth` - Bandwidth in MBs
`purchase_order_number` - Purchase order number applied to billing invoices for this connection.
`aside_ap_type` - Access point type
`aside_link_protocol_type` - Link protocol type
`aside_pri_link_protocol_stag` - S-Tag number for PRIMARY Connection
`aside_sec_link_protocol_stag` - S-Tag number for SECONDARY Connection
`zside_ap_type` - Z side access point type
`zside_ap_authentication_key` - AZURE authorization key, like c620477c-3f30-41e8-a0b9-cf324a12121d
`zside_ap_profile_type` - Service profile type
`zside_location` - Equinix Metro Code for the Z side access point
`fabric_sp_name` - Service profile name like i.e. AZURE
`equinix_pri_port_name` - Name of ECX Fabric Port for the PRIMARY Connection
`equinix_sec_port_name` - Name of ECX Fabric Port for the SECONDARY Connection

## Azure login

Log in to Azure portal with an account that has permission to create necessary resources.

Create an Azure ExpressRoute Circuit and use its Service Key as the Authentication Key in the examples.

Bandwidth in Terraform must match the bandwidth of the ExpressRoute Circuit created in Azure.

## Initialize

Change directory to project root to run terra test or change to example directory and initialize Terraform plugins
by running `terraform init`.

## Deploy template

Apply changes by running `terraform apply`, then **inspect proposed plan**
and approve it.
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

data "equinix_fabric_service_profiles" "azure" {
filter {
property = "/name"
operator = "="
values = [var.fabric_sp_name]
}
}

data "equinix_fabric_ports" "qinq-pri" {
filters {
name = var.equinix_pri_port_name
}
}

data "equinix_fabric_ports" "qinq-sec" {
filters {
name = var.equinix_sec_port_name
}
}

resource "equinix_fabric_connection" "azure-qinq" {
name = var.pri_connection_name
type = var.connection_type
notifications {
type = var.notifications_type
emails = var.notifications_emails
}
bandwidth = var.bandwidth
redundancy {
priority = "PRIMARY"
}
order {
purchase_order_number = var.purchase_order_number
}
a_side {
access_point {
type = var.aside_ap_type
port {
uuid = data.equinix_fabric_ports.qinq-pri.data.0.uuid
}
link_protocol {
type = var.aside_link_protocol_type
vlan_s_tag = var.aside_pri_link_protocol_stag
}
}
}
z_side {
access_point {
type = var.zside_ap_type
authentication_key = var.zside_ap_authentication_key
profile {
type = var.zside_ap_profile_type
uuid = data.equinix_fabric_service_profiles.azure.data.0.uuid
}
location {
metro_code = var.zside_location
}
}
}
}

resource "equinix_fabric_connection" "azure-qinq-second-connection" {
name = var.sec_connection_name
type = var.connection_type
notifications {
type = var.notifications_type
emails = var.notifications_emails
}
bandwidth = var.bandwidth
redundancy {
priority = "SECONDARY"
group = one(equinix_fabric_connection.azure-qinq.redundancy).group
}
order {
purchase_order_number = var.purchase_order_number
}
a_side {
access_point {
type = var.aside_ap_type
port {
uuid = data.equinix_fabric_ports.qinq-sec.data.0.uuid
}
link_protocol {
type = var.aside_link_protocol_type
vlan_s_tag = var.aside_sec_link_protocol_stag
}
}
}
z_side {
access_point {
type = var.zside_ap_type
authentication_key = var.zside_ap_authentication_key
profile {
type = var.zside_ap_profile_type
uuid = data.equinix_fabric_service_profiles.azure.data.0.uuid
}
location {
metro_code = var.zside_location
}
}
}
}

output "connection_result" {
value = equinix_fabric_connection.azure-qinq.id
}

output "second_connection_result" {
value = equinix_fabric_connection.azure-qinq-second-connection.id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_providers {
equinix = {
source = "equinix/equinix"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
equinix_client_id = "MyEquinixClientId"
equinix_client_secret = "MyEquinixSecret"

pri_connection_name = "terraform_port2azure_pri"
sec_connection_name = "terraform_port2azure_sec"
connection_type = "EVPL_VC"
notifications_type = "ALL"
notifications_emails = ["[email protected]"]
bandwidth = 50
purchase_order_number = "1-323292"
aside_ap_type = "COLO"
aside_link_protocol_type = "QINQ"
aside_pri_link_protocol_stag = "2019"
aside_sec_link_protocol_stag = "2020"
zside_ap_type = "SP"
zside_ap_authentication_key = "Azure Express Route Service Key"
zside_ap_profile_type = "L2_PROFILE"
zside_location = "SV"
fabric_sp_name = "Azure ExpressRoute"
equinix_pri_port_name = "ops-user100-CX-SV1-NL-Qinq-STD-10G-PRI-JP-149"
equinix_sec_port_name = "ops-user100-CX-SV1-NL-Qinq-STD-10G-PRI-JP-150"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
variable "equinix_client_id" {}
variable "equinix_client_secret" {}

variable "pri_connection_name" {}
variable "sec_connection_name" {}
variable "connection_type" {}
variable "notifications_type" {}
variable "notifications_emails" {}
variable "bandwidth" {}
variable "purchase_order_number" {}
variable "aside_ap_type" {}
variable "aside_link_protocol_type" {}
variable "aside_pri_link_protocol_stag" {}
variable "aside_sec_link_protocol_stag" {}
variable "zside_ap_type" {}
variable "zside_ap_authentication_key" {}
variable "zside_ap_profile_type" {}
variable "zside_location" {}
variable "fabric_sp_name" {}
variable "equinix_pri_port_name" {}
variable "equinix_sec_port_name" {}

0 comments on commit 46166d2

Please sign in to comment.