Skip to content

Commit bb475c3

Browse files
author
Oscar Cobles
committed
support for bgp configuration
1 parent 9678d80 commit bb475c3

File tree

17 files changed

+414
-69
lines changed

17 files changed

+414
-69
lines changed

README.md

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@
77

88
As part of Platform Equinix, your infrastructure can connect with other parties, such as public cloud providers, network service providers, or your own colocation cages in Equinix by defining an [Equinix Fabric - software-defined interconnection](https://docs.equinix.com/en-us/Content/Interconnection/Fabric/Fabric-landing-main.htm).
99

10-
This module creates a Cloud router or uses an existing one, an InterconnectAttachment in Google Cloud, and the l2 connection in Equinix Fabric using the InterconnectAttachment pairing key.
10+
This module creates a Cloud router or uses an existing one, an InterconnectAttachment in Google Cloud, and the l2 connection in Equinix Fabric using the InterconnectAttachment pairing key. BGP can be optionally configured in both sides if Network Edge device is used.
1111

1212
```html
1313
Origin Destination
1414
(A-side) (Z-side)
1515

1616
┌────────────────┐
17-
│ Equinix Fabric │ Equinix Fabric ┌────────────────────┐ ┌───────────────────────┐
18-
│ Port / Network ├───── l2 connection ───────►│ GCP │──────►│ Clour Router ─► VPC │
19-
│ Edge Device / │ (50 Mbps - 10 Gbps) │ Interconnect │ │ │
20-
│ Service Token │ └────────────────────┘ └───────────────────────┘
21-
└────────────────┘
17+
│ Equinix Fabric │ Equinix Fabric ┌────────────────────┐ ┌────────────────┐
18+
│ Port / Network ├───── l2 connection ───────►│ GCP │──────►│ Clour Router │
19+
│ Edge Device / │ (50 Mbps - 10 Gbps) │ Interconnect │ │ │
20+
│ Service Token │ └────────────────────┘ └────────────────┘
21+
└────────────────┘ │
22+
│ │
23+
└ - - - - - - - - - - Network Edge Device - - - - - - - - - - - - - - - - - ┘
24+
BGP peering
2225
```
2326

2427
### Usage
@@ -60,24 +63,32 @@ module "equinix-fabric-connection-gcp" {
6063

6164
Run `terraform init -upgrade` and `terraform apply`.
6265

63-
#### Resources
66+
-> **NOTE:**
67+
Completing BGP configuration in GCP side is not directly supported with current google terraform provider (v3.72.0). As a workaround this module take advantage of [terraform-google-gcloud](https://registry.terraform.io/modules/terraform-google-modules/gcloud/google/latest) module which allows use gcloud. However, it is only available for `linux` and `darwin` based operating systems. To run this module in a non-supported platfom, 'network_edge_configure_bgp' and 'gcp_configure_bgp' must remain false. Check this [issue](https://github.com/hashicorp/terraform-provider-google/issues/9582) to obtain further information.
68+
69+
### Variables
70+
71+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest?tab=inputs> for a description of all variables.
72+
73+
### Outputs
74+
75+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest?tab=outputs> for a description of all outputs.
76+
77+
### Resources
6478

6579
| Name | Type |
66-
| :-----: | :------: |
80+
|------|------|
6781
| [random_string.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
6882
| [equinix-fabric-connection](https://registry.terraform.io/modules/equinix-labs/fabric-connection/equinix/latest?tab=inputs) | module |
83+
| [equinix_network_bgp.this](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_bgp) | resource |
6984
| [google_compute_interconnect_attachment.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_interconnect_attachment) | resource |
7085
| [google_compute_router.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_router) | resource |
7186
| [google_compute_router.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_router) | data source |
72-
73-
#### Variables
74-
75-
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest?tab=inputs> for a description of all variables.
76-
77-
#### Outputs
78-
79-
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest?tab=outputs> for a description of all outputs.
87+
| [gcloud-configure-bgp](https://registry.terraform.io/modules/terraform-google-modules/gcloud/google/latest) | module |
88+
| [gcloud-get-bgp-addresses](https://registry.terraform.io/modules/terraform-google-modules/gcloud/google/latest) | module |
89+
| [local_file.this](https://registry.terraform.io/providers/hashicorp/local/latest/docs/data-sources/file) | data source |
8090

8191
### Examples
8292

83-
- [examples/simple](examples/simple/)
93+
- [Fabric Port connection example](https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest/examples/fabric-port-connection/)
94+
- [Network Edge device connection](https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest/examples/network-edge-device-connection/)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Fabric Port Connection Example
2+
3+
This example demonstrates usage of the Equinix Connection module to establish a non-redundant Equinix Fabric L2 Connection from a Equinix Fabric port to Google Cloud Interconnect. It will:
4+
5+
- Use VPC 'default'
6+
- Use project specified in provider
7+
- Create a Google Cloud Router
8+
- Create a Google Cloud Interconnect/VLAN Attachment
9+
- Create an Equinix Fabric l2 connection with minimun available bandwidth for Google Cloud service profile
10+
11+
## Usage
12+
13+
To provision this example, you should clone the github repository and run terraform from within this directory:
14+
15+
```bash
16+
git clone https://github.com/equinix-labs/terraform-equinix-fabric-connection-gcp.git
17+
cd terraform-equinix-fabric-connection-gcp/examples/fabric-port-connection
18+
terraform init
19+
terraform apply
20+
```
21+
22+
Note that this example may create resources which cost money. Run 'terraform destroy' when you don't need these resources.
23+
24+
## Variables
25+
26+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest/examples/fabric-port-connection?tab=inputs> for a description of all variables.
27+
28+
## Outputs
29+
30+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest/examples/fabric-port-connection?tab=outputs> for a description of all outputs.
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
provider "equinix" {}
22

33
provider "google" {
4-
project = "example"
5-
region = "europe-west3"
4+
project = var.project_name
5+
region = "europe-west3"
66
}
77

8-
variable "port_name" {}
9-
108
module "equinix-fabric-connection-gcp" {
119
source = "github.com/equinix-labs/terraform-equinix-fabric-connection-gcp"
1210

@@ -18,7 +16,3 @@ module "equinix-fabric-connection-gcp" {
1816
fabric_vlan_stag = 1010
1917
fabric_destination_metro_code = "FR"
2018
}
21-
22-
output "connection_details" {
23-
value = module.equinix-fabric-connection-gcp
24-
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "connection_details" {
2+
value = module.equinix-fabric-connection-gcp
3+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
variable "project_name" {
2+
type = string
3+
description = "The default GCP project to manage resources in."
4+
}
5+
6+
variable "port_name" {
7+
type = string
8+
description = <<EOF
9+
Name of the [Equinix Fabric port](https://docs.equinix.com/en-us/Content/Interconnection/Fabric/ports/Fabric-port-details.htm)
10+
from which the connection would originate.
11+
EOF
12+
}
File renamed without changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Network Edge Device Connection Example
2+
3+
This example demonstrates usage of the Equinix Connection module to establish a non-redundant Equinix Fabric L2 Connection from a Equinix Network Edge device to Google Cloud Interconnect. It will:
4+
5+
- Use 'default' VPC
6+
- Use the `project` specified in provider
7+
- Create a Google Cloud Router
8+
- Create a Google Cloud Interconnect/VLAN Attachment
9+
- Create Equinix Fabric l2 connection with 200 Mbps bandwidth
10+
- Configure BGP session between the GCP cloud router and your Network Edge device
11+
12+
## Usage
13+
14+
To provision this example, you should clone the github repository and run terraform from within this directory:
15+
16+
```bash
17+
git clone https://github.com/equinix-labs/terraform-equinix-fabric-connection-gcp.git
18+
cd terraform-equinix-fabric-connection-gcp/examples/network-edge-device-connection
19+
terraform init
20+
terraform apply
21+
```
22+
23+
Note that this example may create resources which cost money. Run 'terraform destroy' when you don't need these resources.
24+
25+
## Variables
26+
27+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest/examples/network-edge-device-connection?tab=inputs> for a description of all variables.
28+
29+
## Outputs
30+
31+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-gcp/equinix/latest/examples/network-edge-device-connection?tab=outputs> for a description of all outputs.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
provider "equinix" {}
2+
3+
provider "google" {
4+
project = var.project_name
5+
region = "europe-west3"
6+
}
7+
8+
module "equinix-fabric-connection-gcp" {
9+
source = "github.com/equinix-labs/terraform-equinix-fabric-connection-gcp"
10+
11+
# required variables
12+
fabric_notification_users = ["[email protected]"]
13+
14+
# optional variables
15+
network_edge_device_id = var.device_id
16+
network_edge_configure_bgp = true
17+
18+
fabric_destination_metro_code = "FR"
19+
fabric_speed = 200
20+
21+
platform = "darwin"
22+
gcp_gcloud_skip_download = true
23+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
output "fabric_connection_id" {
2+
value = module.equinix-fabric-connection-gcp.fabric_connection_uuid
3+
}
4+
5+
output "fabric_connection_name" {
6+
value = module.equinix-fabric-connection-gcp.fabric_connection_name
7+
}
8+
9+
output "fabric_connection_status" {
10+
value = module.equinix-fabric-connection-gcp.fabric_connection_status
11+
}
12+
13+
output "fabric_connection_provider_status" {
14+
value = module.equinix-fabric-connection-gcp.fabric_connection_provider_status
15+
}
16+
17+
output "network_edge_bgp_provisioning_status" {
18+
description = "Network Edge device BGP peering configuration provisioning status."
19+
value = module.equinix-fabric-connection-gcp.network_edge_bgp_provisioning_status
20+
}
21+
22+
output "gcp_interconnect_id" {
23+
description = "Google Cloud Interconnect/VLAN attachment ID."
24+
value = module.equinix-fabric-connection-gcp.gcp_interconnect_id
25+
}
26+
27+
output "gcp_cloud_router_id" {
28+
description = "Google Cloud Router ID."
29+
value = module.equinix-fabric-connection-gcp.gcp_cloud_router_id
30+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
variable "project_name" {
2+
type = string
3+
description = "The default GCP project to manage resources in."
4+
}
5+
6+
variable "device_id" {
7+
type = string
8+
description = <<EOF
9+
The ID of the (Network Edge virtual device](https://github.com/equinix/terraform-provider-equinix/tree/master/examples/edge-networking)
10+
from which the connection would originate.
11+
EOF
12+
}

0 commit comments

Comments
 (0)