-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Port2Azure Redundant Connection Example (#397)
* Add redundant connection example * Update README.md for both single and redundant connections * Update unused variables for both connections In regards to #384, we will start to use the `_e2e_` tests for regression testing for Fabric resources. At first locally but hopefully in GHA if we can get connecting to the lower environments from there. @manu-equinix was of the mind that we could access UAT environments from GHA.
- Loading branch information
Showing
10 changed files
with
271 additions
and
50 deletions.
There are no files selected for viewing
57 changes: 31 additions & 26 deletions
57
...abric/v4/portConnectivity/azure/README.md → ...ectivity/azure/singleConnection/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
7 changes: 2 additions & 5 deletions
7
...nnectivity/azure/terraform.tfvars.example → ...singleConnection/terraform.tfvars.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
examples/fabric/v4/portConnectivity/azure/twoRedundantConnections/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# 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 | ||
- First step is to initialize the terraform directory/resource we are going to work on. | ||
In the given example, the folder to perform CRUD operations for port2azure redundant connections can be found at examples/fabric/v4/portConnectivity/azure/twoRedundantConnections. | ||
|
||
- Change directory into - `CD examples/fabric/v4/portConnectivity/azure/twoRedundantConnections` | ||
- Initialize Terraform plugins - `terraform init` | ||
|
||
## Port to Azure connection : Create, Read, Update and Delete(CRUD) operations | ||
Note: `–auto-approve` command does not prompt the user for validating the applying config. Remove it to get a prompt to confirm the operation. | ||
|
||
| Operation | Command | Description | | ||
|:----------|:---------------------------------:|--------------------------------------------------------------------------:| | ||
| CREATE | `terraform apply –auto-approve` | Creates a port2azure redundant connection resources | | ||
| READ | `terraform show` | Reads/Shows the current state of the port2azure connection resources | | ||
| UPDATE | `terraform apply -refresh` | Updates the connections with values provided in the terraform.tfvars file | | ||
| DELETE | `terraform destroy –auto-approve` | Deletes the created port2azure connection resources | | ||
|
115 changes: 115 additions & 0 deletions
115
examples/fabric/v4/portConnectivity/azure/twoRedundantConnections/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/fabric/v4/portConnectivity/azure/twoRedundantConnections/terraform.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
examples/fabric/v4/portConnectivity/azure/twoRedundantConnections/terraform.tfvars.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "Terra_Port2Azure_Pri" | ||
sec_connection_name = "Terra_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" |
Oops, something went wrong.