Skip to content

Commit

Permalink
feat: Adding z_side block for virtual device & FCR 2 VD example (#38)
Browse files Browse the repository at this point in the history
* feat: Adding z_side block for virtual device & FCR 2 VD example

* feat: Adding FCR 2 VD redundant example

* nit: Adding indentation space and changing variables names

* misc: Updating variables for FCR 2 NE Redundant connection & adding content readme.md file

* nit: Removing extra line from REDME.md file.

* misc: Adding output id for secondary connection and changing variable name for DOT1Q vlan_tag

* chore: Fixing format

* chore: Updating README.md file

* fix: Adding secondary VD variables in modules main.tf file
  • Loading branch information
srushti-patl authored Mar 15, 2024
1 parent 29720d6 commit 2fdf5a8
Show file tree
Hide file tree
Showing 17 changed files with 387 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/cloud-router-2-port-connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ module "cloud_router_port_connection" {
zside_ap_type = var.zside_ap_type
zside_location = var.zside_location
zside_port_name = var.zside_port_name
zside_vlan_outer_tag = var.zside_vlan_outer_tag
zside_vlan_tag = var.zside_vlan_tag
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ connection_type = "IP_VC"
bandwidth = 50
aside_ap_type = "CLOUD_ROUTER"
zside_ap_type = "COLO"
zside_vlan_outer_tag = "2711"
zside_vlan_tag = "2711"
zside_location = "SV"
zside_port_name = "<Equinix Port Name>"
2 changes: 1 addition & 1 deletion examples/cloud-router-2-port-connection/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ variable "zside_ap_type" {
type = string
default = "SP"
}
variable "zside_vlan_outer_tag" {
variable "zside_vlan_tag" {
description = "Access point protocol Vlan tag number for DOT1Q or QINQ connections"
default = ""
}
Expand Down
13 changes: 13 additions & 0 deletions examples/cloud-router-2-virtual-device-connection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Fabric Cloud Router to Virtual Device 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 Virtual Device.

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.

<!-- Begin Example Usage (Do not edit contents) -->
<!-- End Example Usage -->
26 changes: 26 additions & 0 deletions examples/cloud-router-2-virtual-device-connection/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

module "cloud_router_virtual_device_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
purchase_order_number = var.purchase_order_number

#Aside
aside_ap_type = var.aside_ap_type
aside_fcr_uuid = var.aside_fcr_uuid

#Zside
zside_ap_type = var.zside_ap_type
zside_vd_type = var.zside_vd_type
zside_vd_uuid = var.zside_vd_uuid
zside_interface_type = var.zside_interface_type
zside_interface_id = var.zside_interface_id
}
3 changes: 3 additions & 0 deletions examples/cloud-router-2-virtual-device-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "FCR_VD_Connection" {
value = module.cloud_router_virtual_device_connection.primary_connection_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
equinix_client_id = "<MyEquinixClientId>"
equinix_client_secret = "<MyEquinixSecret>"

notifications_type = "ALL"
notifications_emails = ["[email protected]", "[email protected]"]
purchase_order_number = "1-323292"
connection_name = "fcr_2_vd"
connection_type = "IP_VC"
bandwidth = 50

aside_fcr_uuid = "<Fabric Cloud Router UUID>"
aside_ap_type = "CLOUD_ROUTER"

zside_ap_type = "VD"
zside_vd_type = "EDGE"
zside_vd_uuid = "<Virtual Device UUID>"
zside_interface_type = "NETWORK"
zside_interface_id = 5
67 changes: 67 additions & 0 deletions examples/cloud-router-2-virtual-device-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
type = string
}
variable "connection_type" {
description = "Defines the connection type like VG_VC, EVPL_VC, EPL_VC, EC_VC, IP_VC, ACCESS_EPL_VC"
type = string
}
variable "notifications_type" {
description = "Notification Type - ALL is the only type currently supported"
type = string
default = "ALL"
}
variable "notifications_emails" {
description = "Array of contact emails"
type = list(string)
}
variable "bandwidth" {
description = "Connection bandwidth in Mbps"
type = number
}
variable "purchase_order_number" {
description = "Purchase order number"
type = string
default = ""
}
variable "aside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
type = string
}
variable "aside_fcr_uuid" {
description = "Equinix-assigned Fabric Cloud Router identifier"
type = string
}
variable "zside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
type = string
default = "VD"
}
variable "zside_vd_type" {
description = "Virtual Device type - EDGE"
type = string
}
variable "zside_vd_uuid" {
description = "Virtual Device UUID"
type = string
}
variable "zside_interface_type" {
description = "Virtual Device Interface type - CLOUD, NETWORK"
type = string
default = ""
}
variable "zside_interface_id" {
description = "Interface Id"
type = number
default = null
}
9 changes: 9 additions & 0 deletions examples/cloud-router-2-virtual-device-connection/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.31.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Fabric Cloud Router to Virtual Device 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 Virtual Devices using two connections.A Primary and secondary connection.

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.

<!-- Begin Example Usage (Do not edit contents) -->
<!-- End Example Usage -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

module "cloud_router_virtual_device_redundant_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
purchase_order_number = var.purchase_order_number

#Aside
aside_ap_type = var.aside_ap_type
aside_fcr_uuid = var.aside_fcr_uuid

#Zside
zside_ap_type = var.zside_ap_type
zside_vd_type = var.zside_vd_type
zside_vd_uuid = var.zside_vd_uuid
zside_interface_type = var.zside_interface_type
zside_interface_id = var.zside_interface_id

#Secondary-Connection
secondary_connection_name = var.secondary_connection_name
secondary_bandwidth = var.secondary_bandwidth
zside_sec_vd_uuid = var.zside_sec_vd_uuid
zside_sec_interface_type = var.zside_sec_interface_type
zside_sec_interface_id = var.zside_sec_interface_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "FCR_VD_Primary_Connection" {
value = module.cloud_router_virtual_device_redundant_connection.primary_connection_id
}
output "FCR_VD_Secondary_Connection" {
value = module.cloud_router_virtual_device_redundant_connection.secondary_connection_id
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
equinix_client_id = "<MyEquinixClientId>"
equinix_client_secret = "<MyEquinixSecret>"

notifications_type = "ALL"
notifications_emails = ["[email protected]", "[email protected]"]
purchase_order_number = "1-323292"
aside_fcr_uuid = "<Fabric Cloud Router UUID>"
connection_name = "FCR_2_VD_Pri"
connection_type = "IP_VC"
bandwidth = 50
aside_ap_type = "CLOUD_ROUTER"

zside_ap_type = "VD"
zside_vd_type = "EDGE"
zside_vd_uuid = "<Primary Virtual Device UUID>"
zside_interface_type = "NETWORK"
zside_interface_id = 5

secondary_connection_name = "FCR_2_VD_sec"
secondary_bandwidth = 50
zside_vd_sec_uuid = "<Secondary Virtual Device UUID>"
zside_sec_interface_type = "NETWORK"
zside_sec_interface_id = 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
type = string
}
variable "connection_type" {
description = "Defines the connection type like VG_VC, EVPL_VC, EPL_VC, EC_VC, IP_VC, ACCESS_EPL_VC"
type = string
}
variable "notifications_type" {
description = "Notification Type - ALL is the only type currently supported"
type = string
default = "ALL"
}
variable "notifications_emails" {
description = "Array of contact emails"
type = list(string)
}
variable "bandwidth" {
description = "Connection bandwidth in Mbps"
type = number
}
variable "purchase_order_number" {
description = "Purchase order number"
type = string
default = ""
}
variable "aside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
type = string
}
variable "aside_fcr_uuid" {
description = "Equinix-assigned Fabric Cloud Router identifier"
type = string
}
variable "zside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
type = string
default = "VD"
}
variable "zside_vd_type" {
description = "Virtual Device type - EDGE"
type = string
}
variable "zside_vd_uuid" {
description = "Virtual Device UUID"
type = string
}
variable "zside_interface_type" {
description = "Virtual Device Interface type - CLOUD, NETWORK"
type = string
default = ""
}
variable "zside_interface_id" {
description = "Interface Id"
type = number
default = null
}
variable "secondary_connection_name" {
description = "Secondary Connection name"
type = string
}
variable "secondary_bandwidth" {
description = "Secondary Connection bandwidth in Mbps"
type = number
default = 50
}
variable "zside_sec_vd_uuid" {
description = "Secondary Virtual Device UUID"
type = string
}
variable "zside_sec_interface_type" {
description = "Secondary Virtual Device Interface type - CLOUD, NETWORK"
type = string
default = ""
}
variable "zside_sec_interface_id" {
description = "Secondary Interface Id"
type = number
default = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.31.0"
}
}
}
Loading

0 comments on commit 2fdf5a8

Please sign in to comment.