diff --git a/CHANGELOG.md b/CHANGELOG.md index cee4de6..dabef2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 0.2.0 (July 22, 2022) + +ENHANCEMENTS: + +- New example to establish an Equinix Fabric L2 Connection from Equinix Metal to IBM using an A-side Service Token +- Version of `equinix-fabric-connection` module was updated to v0.3.1 +- Version of required equinix provider was updated to v1.7.0 + +BUG FIXES: + +- typo `purchase_order` was `purcharse_order` + ## 0.1.0 (April 29, 2022) NOTES: diff --git a/README.md b/README.md index 8fa26c1..a223d33 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,6 @@ See Equinix Metal connection with automated `a_side` service token is not generally available and may not be enabled yet for your organization. + +This example demonstrates usage of the Equinix Connection IBM module to establish an Equinix Fabric L2 Connection from Equinix Metal (a-side) to IBM Direct Link 2.0 using an [A-Side Token](https://docs.equinix.com/en-us/Content/Interconnection/Fabric/service%20tokens/Fabric-Service-Tokens.htm).It will: + +- Use an existing Equinix Metal project. +- Create a new Equinix Metal VLAN in selected metro Silicon Valley (SV). +- Request an Equinix Metal shared connection in SV. +- Attach the Equinix Metal VLAN to the Virtual Circuit created for the Equinix Metal connection. +- Create an IBM VPC. +- Provision an Equinix Fabric l2 connection for IBM service profile with specified bandwidth and private peering. +- Approve IBM connection request. +- Create an IBM Direct Link virtual connection to the new IBM VPC. + +## Usage + +To provision this example, you should clone the github repository and run terraform from within this directory: + +```bash +git clone https://github.com/equinix-labs/terraform-equinix-fabric-connection-ibm.git +cd terraform-equinix-fabric-connection-ibm/examples/service-token-metal-to-ibm-connection +terraform init +terraform apply +``` + +Note that this example may create resources which cost money. Run 'terraform destroy' when you don't need these resources. + +## Variables + +See for a description of all variables. + +## Outputs + +See for a description of all outputs. diff --git a/examples/service-token-metal-to-ibm-connection/main.tf b/examples/service-token-metal-to-ibm-connection/main.tf new file mode 100644 index 0000000..0145801 --- /dev/null +++ b/examples/service-token-metal-to-ibm-connection/main.tf @@ -0,0 +1,73 @@ +# Configure the Equinix Provider +# Please refer to provider documentation for details on supported authentication methods and parameters. +# https://registry.terraform.io/providers/equinix/equinix/latest/docs +provider "equinix" { + client_id = var.equinix_provider_client_id + client_secret = var.equinix_provider_client_secret +} + +# Configure the IBM Provider +# https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs#argument-reference +provider "ibm" { + ibmcloud_api_key = var.ibm_api_key // To create an API key, in the IBM Cloud console, go to Manage > Access (IAM) > API keys. + region = var.ibm_region // If unspecified, default region "us-south" (Dallas) will be used. +} + +## Retrieve an existing equinix metal project +## If you prefer you can use resource equinix_metal_project instead to create a fresh project +data "equinix_metal_project" "this" { + project_id = var.metal_project_id +} + +## Create an IBM VPC +## Comment out this block if ibm_create_dl_virtual_connection is false +## If you prefer you can use data ibm_is_vpc instead to use an existing VPC +resource "ibm_is_vpc" "this" { + name = format("vpc-metal-ibm-%s", lower(var.fabric_destination_metro_code)) +} + +locals { + connection_name = format("conn-metal-ibm-%s", lower(var.fabric_destination_metro_code)) +} + +# Create a new VLAN in Frankfurt +resource "equinix_metal_vlan" "this" { + description = format("VLAN in %s", var.fabric_destination_metro_code) + metro = var.fabric_destination_metro_code + project_id = data.equinix_metal_project.this.project_id +} + +## Request a connection service token in Equinix Metal +resource "equinix_metal_connection" "this" { + name = local.connection_name + project_id = data.equinix_metal_project.this.project_id + metro = var.fabric_destination_metro_code + redundancy = "primary" + type = "shared" + service_token_type = "a_side" + description = format("connection to IBM in %s", var.fabric_destination_metro_code) + speed = format("%dMbps", var.fabric_speed) + vlans = [equinix_metal_vlan.this.vxlan] +} + +## Configure the Equinix Fabric connection from Equinix Metal to AWS using the metal connection service token +module "equinix-fabric-connection-ibm-primary" { + source = "equinix-labs/fabric-connection-ibm/equinix" + + fabric_notification_users = var.fabric_notification_users + fabric_connection_name = local.connection_name + fabric_destination_metro_code = var.fabric_destination_metro_code + fabric_speed = var.fabric_speed + fabric_service_token_id = equinix_metal_connection.this.service_tokens.0.id + + ibm_account_id = var.ibm_account_id + ibm_api_key = var.ibm_api_key + + ibm_create_dl_virtual_connection = true + ibm_vpc_id = ibm_is_vpc.this.id // required if ibm_create_dl_virtual_connection is true + + ## BGP Configuration + # ibm_direct_link_bgp_customer_peer_ip = "10.254.30.77/30" // If unspecified, it will be auto-generated + # ibm_direct_link_bgp_cloud_peer_ip = "10.254.30.78" // If unspecified, it will be auto-generated + # ibm_direct_link_bgp_customer_asn = 65000 // If unspecified, default value "65000" will be used +} diff --git a/examples/service-token-metal-to-ibm-connection/outputs.tf b/examples/service-token-metal-to-ibm-connection/outputs.tf new file mode 100644 index 0000000..00c6fe3 --- /dev/null +++ b/examples/service-token-metal-to-ibm-connection/outputs.tf @@ -0,0 +1,3 @@ +output "connection_primary_details" { + value = module.equinix-fabric-connection-ibm-primary +} \ No newline at end of file diff --git a/examples/service-token-metal-to-ibm-connection/variables.tf b/examples/service-token-metal-to-ibm-connection/variables.tf new file mode 100644 index 0000000..9aa16c3 --- /dev/null +++ b/examples/service-token-metal-to-ibm-connection/variables.tf @@ -0,0 +1,79 @@ +variable "equinix_provider_client_id" { + type = string + description = < Access (IAM) > API keys. + EOF + default = "" +} + +variable "ibm_account_id" { + type = string + description = < Account > Account + settings to locate your IBM account ID. + EOF +} + +variable "ibm_vpc_name" { + type = string + description = "(Required) The name of an existing VPC." +} + +variable "ibm_region" { + type = string + description = <