-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add routing protocols module with example * Remove empty version from provider statements
- Loading branch information
Showing
18 changed files
with
206 additions
and
9 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
Empty file.
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,31 @@ | ||
terraform { | ||
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
} | ||
} | ||
} | ||
|
||
provider "equinix" { | ||
client_id = var.equinix_client_id | ||
client_secret = var.equinix_client_secret | ||
} | ||
|
||
module "routing_protocols" { | ||
source = "../../modules/routing-protocols" | ||
|
||
connection_uuid = var.connection_uuid | ||
|
||
# Direct RP Details | ||
direct_rp_name = var.direct_rp_name | ||
direct_equinix_ipv4_ip = var.direct_equinix_ipv4_ip | ||
direct_equinix_ipv6_ip = var.direct_equinix_ipv6_ip | ||
|
||
# BGP RP Details | ||
bgp_rp_name = var.bgp_rp_name | ||
bgp_customer_asn = var.bgp_customer_asn | ||
bgp_customer_peer_ipv4 = var.bgp_customer_peer_ipv4 | ||
bgp_enabled_ipv4 = var.bgp_enabled_ipv4 | ||
bgp_customer_peer_ipv6 = var.bgp_customer_peer_ipv6 | ||
bgp_enabled_ipv6 = var.bgp_enabled_ipv6 | ||
} |
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 @@ | ||
output "direct_rp_id" { | ||
value = module.routing_protocols.direct_routing_protocol_id | ||
} | ||
|
||
output "bgp_rp_id" { | ||
value = module.routing_protocols.bgp_routing_protocol_id | ||
} |
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,15 @@ | ||
equinix_client_id = "<MyEquinixClientId>" | ||
equinix_client_secret = "<MyEquinixSecret>" | ||
|
||
connection_uuid = "<Equinix_Connection_UUID>" | ||
|
||
direct_rp_name = "DIRECT_RP" | ||
direct_equinix_ipv4_ip = "190.1.1.1/30" | ||
direct_equinix_ipv6_ip = "190::1:1/126" | ||
|
||
bgp_rp_name = "BGP_RP" | ||
bgp_customer_peer_ipv4 = "190.1.1.2" | ||
bgp_customer_peer_ipv6 = "190::1:2" | ||
bgp_enabled_ipv4 = true | ||
bgp_enabled_ipv6 = true | ||
bgp_customer_asn = "100" |
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,57 @@ | ||
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 "connection_uuid" { | ||
description = "Equinix Connection UUID to Apply the Routing Protocols to" | ||
type = string | ||
} | ||
variable "direct_rp_name" { | ||
description = "Name of the Direct Routing Protocol" | ||
type = string | ||
} | ||
variable "direct_equinix_ipv4_ip" { | ||
description = "IPv4 Address for Direct Routing Protocol" | ||
type = string | ||
} | ||
variable "direct_equinix_ipv6_ip" { | ||
description = "IPv6 Address for Direct Routing Protocol" | ||
type = string | ||
} | ||
|
||
|
||
variable "bgp_rp_name" { | ||
description = "Name of the BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} | ||
variable "bgp_customer_peer_ipv4" { | ||
description = "Customer Peering IPv4 Address for BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} | ||
variable "bgp_customer_peer_ipv6" { | ||
description = "Customer Peering IPv6 Address for BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} | ||
variable "bgp_enabled_ipv4" { | ||
description = "Boolean Enable Flag for IPv4 Peering on BGP Routing Protocol" | ||
type = bool | ||
default = true | ||
} | ||
variable "bgp_enabled_ipv6" { | ||
description = "Boolean Enable Flag for IPv6 Peering on BGP Routing Protocol" | ||
type = bool | ||
default = true | ||
} | ||
variable "bgp_customer_asn" { | ||
description = "Customer ASN for BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ terraform { | |
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
version = "" | ||
} | ||
} | ||
} | ||
|
Empty file.
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,41 @@ | ||
terraform { | ||
required_providers { | ||
equinix = { | ||
source = "equinix/equinix" | ||
} | ||
} | ||
} | ||
|
||
resource "equinix_fabric_routing_protocol" "direct" { | ||
connection_uuid = var.connection_uuid | ||
name = var.direct_rp_name | ||
type = "DIRECT" | ||
direct_ipv4 { | ||
equinix_iface_ip = var.direct_equinix_ipv4_ip | ||
} | ||
direct_ipv6 { | ||
equinix_iface_ip = var.direct_equinix_ipv6_ip | ||
} | ||
} | ||
|
||
resource "equinix_fabric_routing_protocol" "bgp" { | ||
count = var.bgp_rp_name != "" ? 1 : 0 | ||
depends_on = [ | ||
equinix_fabric_routing_protocol.direct | ||
] | ||
|
||
connection_uuid = var.connection_uuid | ||
name = var.bgp_rp_name | ||
type = "BGP" | ||
|
||
customer_asn = var.bgp_customer_asn | ||
|
||
bgp_ipv4 { | ||
enabled = var.bgp_enabled_ipv4 | ||
customer_peer_ip = var.bgp_customer_peer_ipv4 | ||
} | ||
bgp_ipv6 { | ||
enabled = var.bgp_enabled_ipv6 | ||
customer_peer_ip = var.bgp_customer_peer_ipv6 | ||
} | ||
} |
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 @@ | ||
output "direct_routing_protocol_id" { | ||
value = equinix_fabric_routing_protocol.direct.id | ||
} | ||
|
||
output "bgp_routing_protocol_id" { | ||
value = var.bgp_rp_name != "" ? equinix_fabric_routing_protocol.bgp[0].id : null | ||
} |
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,48 @@ | ||
variable "connection_uuid" { | ||
description = "Equinix Connection UUID to Apply the Routing Protocols to" | ||
type = string | ||
} | ||
variable "direct_rp_name" { | ||
description = "Name of the Direct Routing Protocol" | ||
type = string | ||
} | ||
variable "direct_equinix_ipv4_ip" { | ||
description = "IPv4 Address for Direct Routing Protocol" | ||
type = string | ||
} | ||
variable "direct_equinix_ipv6_ip" { | ||
description = "IPv6 Address for Direct Routing Protocol" | ||
type = string | ||
} | ||
|
||
|
||
variable "bgp_rp_name" { | ||
description = "Name of the BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} | ||
variable "bgp_customer_peer_ipv4" { | ||
description = "Customer Peering IPv4 Address for BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} | ||
variable "bgp_customer_peer_ipv6" { | ||
description = "Customer Peering IPv6 Address for BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} | ||
variable "bgp_enabled_ipv4" { | ||
description = "Boolean Enable Flag for IPv4 Peering on BGP Routing Protocol" | ||
type = bool | ||
default = true | ||
} | ||
variable "bgp_enabled_ipv6" { | ||
description = "Boolean Enable Flag for IPv6 Peering on BGP Routing Protocol" | ||
type = bool | ||
default = true | ||
} | ||
variable "bgp_customer_asn" { | ||
description = "Customer ASN for BGP Routing Protocol" | ||
type = string | ||
default = "" | ||
} |