Skip to content

Commit 9c3e8f0

Browse files
author
Oscar Cobles
committed
initial version
1 parent 6b933be commit 9c3e8f0

File tree

26 files changed

+522
-316
lines changed

26 files changed

+522
-316
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 0.1.0 (April 18, 2022)
2+
3+
NOTES:
4+
5+
Initial release.
6+
7+
FEATURES:
8+
9+
- Supported single connections from Equinix Fabric Port, Network Edge Device, Equinix Service Token
10+
to service profiles `Equinix Metal - Layer 2` and `Equinix Metal - Layer 2 - Redundant`.

CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
* @equinix-labs/terraform-metal-shared-connection ocobleseqx
1+
# TEMPLATE: add your username after terraform
2+
# TEMPLATE: * equinix-labs/terraform myusername
3+
* @ocobleseqx

README.md

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
## terraform-metal-shared-connection
1+
## Equinix Fabric L2 Connection To Equinix Metal Connection Terraform module
22

33
[![Experimental](https://img.shields.io/badge/Stability-Experimental-red.svg)](https://github.com/equinix-labs/standards#about-uniform-standards)
44
[![terraform](https://github.com/equinix-labs/terraform-equinix-template/actions/workflows/integration.yaml/badge.svg)](https://github.com/equinix-labs/terraform-equinix-template/actions/workflows/integration.yaml)
55

6-
`terraform-metal-shared-connection` is a minimal Terraform module that utilizes [Terraform providers for Equinix](https://registry.terraform.io/namespaces/equinix) to set up an Equinix Metal shared connection.
6+
`terraform-equinix-fabric-connection-metal` is a minimal Terraform module that utilizes [Terraform providers for Equinix](https://registry.terraform.io/namespaces/equinix) to set up an Equinix Metal shared connection.
77

88
A part of Platform Equinix, your Equinix Metal™ 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 interconnections](https://metal.equinix.com/developers/docs/equinix-interconnect/introduction/)
99

1010
Setting Up a Shared Port requires requesting the connection on the Equinix Metal side, retrieving a token and using that token to request a connection on the Equinix Fabric side. This module is intended to abstract you from this process and handle the connection as a single resource.
1111

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

1616
┌────────────────┐ ┌───────────────┐
1717
│ Equinix Fabric │ Equinix Metal │ Equinix Metal │
1818
│ Port / Network ├───── Shared connection ───────►│ Shared Port │
19-
│ Edge Device │ (50 Mbps - 10 Gbps) │ │
20-
└────────────────┘ └───────────────┘
19+
│ Edge Device / │ (50 Mbps - 10 Gbps) └───────────────┘
20+
│ Service Token │
21+
└────────────────┘
2122
```
2223

2324
### Usage
@@ -33,58 +34,45 @@ This project may also be used as a [Terraform module](https://learn.hashicorp.co
3334
To use this module in a new project, create a file such as:
3435

3536
```hcl
36-
# main.tf
37-
terraform {
38-
required_providers {
39-
equinix = {
40-
source = "equinix/equinix"
41-
}
42-
metal = {
43-
source = "equinix/metal"
44-
}
45-
}
37+
provider "equinix" {}
38+
39+
variable "metal_project_name" {}
40+
variable "edge_device_id" {}
41+
42+
module "equinix-fabric-connection-metal" {
43+
source = "github.com/equinix-labs/terraform-equinix-fabric-connection-metal"
44+
45+
# required variables
46+
fabric_notification_users = ["example@equinix.com"]
47+
fabric_destination_metro_code = "SV"
4648
47-
module "example" {
48-
source = "github.com/equinix-labs/terraform-metal-shared-connection"
49+
metal_project_name = var.metal_project_name
4950
50-
# TEMPLATE: insert required variables here
51+
# optional variables
52+
network_edge_device_id = var.edge_device_id
5153
}
5254
```
5355

5456
Run `terraform init -upgrade` and `terraform apply`.
5557

56-
5758
#### Resources
5859

5960
| Name | Type |
6061
| :-----: | :------: |
61-
| [metal_project.this](https://registry.terraform.io/providers/equinix/metal/latest/docs/data-sources/project) | data source |
62-
| [metal_connection.this](https://registry.terraform.io/providers/equinix/metal/latest/docs/resources/device) | resource |
63-
| [equinix_ecx_l2_connection.this](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/ecx_l2_connection) | resource |
64-
| [equinix_ecx_l2_sellerprofile.this](https://registry.terraform.io/providers/equinix/equinix/latest/docs/data-sources/ecx_l2_sellerprofile) | data source |
65-
| [equinix_ecx_port.primary](https://registry.terraform.io/providers/equinix/equinix/latest/docs/data-sources/ecx_port) | data source |
66-
| [equinix_ecx_port.secondary](https://registry.terraform.io/providers/equinix/equinix/latest/docs/data-sources/ecx_port) | data source |
62+
| [equinix_metal_project.this](https://registry.terraform.io/providers/equinix/metal/latest/docs/data-sources/project) | data source |
63+
| [equinix_metal_connection.this](https://registry.terraform.io/providers/equinix/metal/latest/docs/resources/device) | resource |
64+
| [equinix-fabric-connection](https://registry.terraform.io/modules/equinix-labs/fabric-connection/equinix/latest) | module |
6765

6866
#### Variables
6967

70-
| Variable Name | Type | Default Value | Description |
71-
| :--------------------: | :-----: | :-------------------------: | :------------------------------------------------------ |
72-
| | | | |
73-
74-
TBD
75-
76-
<!-- TEMPLATE: If published, remove the table and use the following: See <https://registry.terraform.io/modules/equinix-labs/template/equinix/latest?tab=inputs> for a description of all variables. -->
68+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-metal/equinix/latest?tab=inputs> for a description of all variables.
7769

7870
#### Outputs
7971

80-
| Variable Name | Type | Description |
81-
| :--------------------: | :-----: | :------------------------------------------------------ |
82-
| | | |
83-
84-
TBD
85-
86-
<!-- TEMPLATE: If published, remove the table and use the following: See <https://registry.terraform.io/modules/equinix-labs/template/equinix/latest?tab=outputs> for a description of all outputs. -->
72+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-metal/equinix/latest?tab=outputs> for a description of all outputs.
8773

8874
### Examples
8975

90-
- [examples/device-redundant-connection](examples/device-redundant-connection/)
76+
- [Fabric Port redundant connection](https://registry.terraform.io/modules/equinix-labs/fabric-connection-metal/equinix/latest/examples/fabric-port-redundant-connection/)
77+
- [Network Edge device redundant connection](https://registry.terraform.io/modules/equinix-labs/fabric-connection-metal/equinix/latest/examples/network-edge-device-redundant-connection/)
78+
- [Fabric a-side Service Token redundant connection](https://registry.terraform.io/modules/equinix-labs/fabric-connection-metal/equinix/latest/examples/service-token-redundant-connection)

examples/device-redundant-connection/.terraform.lock.hcl

Lines changed: 0 additions & 43 deletions
This file was deleted.

examples/device-redundant-connection/main.tf

Lines changed: 0 additions & 36 deletions
This file was deleted.

examples/device-redundant-connection/outputs.tf

Lines changed: 0 additions & 24 deletions
This file was deleted.

examples/device-redundant-connection/variables.tf

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Equinix Fabric Port Connection Example
2+
3+
This example demonstrates usage of the Equinix Connection Metal module to establish a single Equinix Fabric L2 Connection from an Equinix Fabric Port to Equinix Metal. It will:
4+
5+
- Create a Metal shared non-redundant connection in Frankfurt.
6+
- Create Equinix Fabric l2 connection in Frankfurt for 'Equinix Metal - Layer 2' service profile with 200Mbps bandwidth.
7+
8+
## Usage
9+
10+
To provision this example, you should clone the github repository and run terraform from within this directory:
11+
12+
```bash
13+
git clone https://github.com/equinix-labs/terraform-equinix-fabric-connection-metal.git
14+
cd terraform-equinix-fabric-connection-metal/examples/network-edge-device-redundant-connection
15+
terraform init
16+
terraform apply
17+
```
18+
19+
Note that this example may create resources which cost money. Run 'terraform destroy' when you don't need these resources.
20+
21+
## Variables
22+
23+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-metal/equinix/latest/examples/network-edge-device-redundant-connection?tab=inputs> for a description of all variables.
24+
25+
## Outputs
26+
27+
See <https://registry.terraform.io/modules/equinix-labs/fabric-connection-metal/equinix/latest/examples/network-edge-device-redundant-connection?tab=outputs> for a description of all outputs.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Interacting with Equinix Metal requires an API auth token in addition to the Equinix API
2+
// credentials. See provider docs for further details
3+
// https://registry.terraform.io/providers/equinix/equinix/latest/docs
4+
provider "equinix" {}
5+
6+
module "equinix-fabric-connection-metal" {
7+
source = "github.com/equinix-labs/terraform-equinix-fabric-connection-metal"
8+
9+
# required variables
10+
fabric_notification_users = ["example@equinix.com"]
11+
fabric_destination_metro_code = "FR" // corresponds to Frankfurt
12+
13+
metal_project_name = var.metal_project_name
14+
15+
# optional variables
16+
fabric_speed = 200
17+
fabric_connection_name = local.connection_name
18+
fabric_port_name = var.fabric_port_name
19+
fabric_vlan_stag = 1010
20+
21+
metal_connection_name = local.connection_name
22+
metal_connection_description = "My shared connection from an Equinix Fabric Port"
23+
}
24+
25+
locals {
26+
// Optionally you can use the same name on both sides Equinix Fabric and Equinix Metal to easily
27+
// identify the connection
28+
connection_name = format("example-fr-%s", random_string.this.result)
29+
}
30+
31+
resource "random_string" "this" {
32+
length = 3
33+
special = false
34+
upper = false
35+
}
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-metal
3+
}

0 commit comments

Comments
 (0)