Skip to content

Commit

Permalink
CXF-80887 Adding Azure Cloud Provider to Azure connection examples (#19)
Browse files Browse the repository at this point in the history
* CXF-80887 Adding Azure Cloud Provider to Azure connection examples

* CXF-80887 Adding new line to end of life
  • Loading branch information
srushti-patl authored Jan 5, 2024
1 parent 7dab707 commit fe7e144
Show file tree
Hide file tree
Showing 16 changed files with 399 additions and 49 deletions.
32 changes: 30 additions & 2 deletions examples/cloud-router-2-azure-connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,43 @@ 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 = "../../modules/cloud-router-connection"

connection_name = var.connection_name
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
Expand All @@ -19,7 +47,7 @@ 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
Expand Down
11 changes: 11 additions & 0 deletions examples/cloud-router-2-azure-connection/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ zside_ap_profile_type = "L2_PROFILE"
zside_location = "SV"
zside_peering_type = "PRIVATE"
zside_fabric_sp_name = "Azure ExpressRoute"
azure_client_id = "<Azure Client Id>"
azure_client_secret = "<Azure Client Secret Value>"
azure_tenant_id = "<Azure Tenant Id>"
azure_subscription_id = "<Azure Subscription Id>"
azure_location = "West US 2"
azure_service_key_name = "Test_Azure_Key"
azure_service_provider_name = "<Service Provider Name>"
azure_peering_location = "Silicon Valley Test"
azure_tier = "Standard"
azure_family = "UnlimitedData"
azure_environment = "PROD"
56 changes: 50 additions & 6 deletions examples/cloud-router-2-azure-connection/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,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
Expand All @@ -72,3 +66,53 @@ 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
}
4 changes: 4 additions & 0 deletions examples/cloud-router-2-azure-connection/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ terraform {
source = "equinix/equinix"
version = ">= 1.20.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "3.84.0"
}
}
}
34 changes: 31 additions & 3 deletions examples/cloud-router-2-azure-redundant-connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,35 @@ 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 = "../../modules/cloud-router-connection"

Expand All @@ -11,7 +39,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
Expand All @@ -20,14 +48,14 @@ 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
zside_peering_type = var.zside_peering_type

#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
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ zside_location = "SV"
zside_peering_type = "PRIVATE"
zside_seller_region = "us-west-1"
zside_fabric_sp_name = "Azure ExpressRoute"
azure_client_id = "<Azure Client Id>"
azure_client_secret = "<Azure Client Secret Value>"
azure_tenant_id = "<Azure Tenant Id>"
azure_subscription_id = "<Azure Subscription Id>"
azure_location = "West US 2"
azure_service_key_name = "Test_Azure_Key"
azure_service_provider_name = "<Service Provider Name>"
azure_peering_location = "Silicon Valley Test"
azure_tier = "Standard"
azure_family = "UnlimitedData"
azure_environment = "PROD"
61 changes: 51 additions & 10 deletions examples/cloud-router-2-azure-redundant-connection/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,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
Expand Down Expand Up @@ -81,13 +76,59 @@ 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
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ terraform {
source = "equinix/equinix"
version = ">= 1.20.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "3.84.0"
}
}
}
33 changes: 31 additions & 2 deletions examples/port-2-azure-connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,43 @@ 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 = "../../modules/port-connection"

connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
bandwidth = azurerm_express_route_circuit.port2azure.bandwidth_in_mbps
purchase_order_number = var.purchase_order_number

# A-side
Expand All @@ -20,7 +48,8 @@ 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
Expand Down
17 changes: 14 additions & 3 deletions examples/port-2-azure-connection/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
equinix_client_id = "MyEquinixClientId"
equinix_client_secret = "MyEquinixSecret"
equinix_client_id = "<MyEquinixClientId>"
equinix_client_secret = "<MyEquinixSecret>"

connection_name = "Port2Azure"
connection_type = "EVPL_VC"
Expand All @@ -11,7 +11,18 @@ 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 = "<Azure Express Route Service Key>"
zside_ap_profile_type = "L2_PROFILE"
zside_location = "SV"
zside_sp_name = "Azure ExpressRoute"
zside_peering_type = "PRIVATE"
azure_client_id = "<Azure Client Id>"
azure_client_secret = "<Azure Client Secret Value>"
azure_tenant_id = "<Azure Tenant Id>"
azure_subscription_id = "<Azure Subscription Id>"
azure_location = "West US 2"
azure_service_key_name = "Test_Azure_Key"
azure_service_provider_name = "<Service Provider Name>"
azure_peering_location = "Silicon Valley Test"
azure_tier = "Standard"
azure_family = "UnlimitedData"
azure_environment = "PROD"
Loading

0 comments on commit fe7e144

Please sign in to comment.