Deploys a fully-meshed global Layer 3 WAN using Megaport Cloud Routers (MCRs) across North America, Europe, and Asia Pacific.
CORE BACKBONE
┌──────────┐ ┌──────────┐ ┌──────────┐
│ MCR1/2 │◄───────►│ MCR3/4 │◄───────►│ MCR5/6 │
│ NAM │ │ Europe │ │ APAC │
│AS65001-2 │ │AS65003-4 │ │AS65005-6 │
└────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │
┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│Toronto │ │Stockholm│ │ Sydney │
│LA / NYC │ │ │ │ │
└─────────┘ └─────────┘ └─────────┘
What gets deployed:
- 6 MCRs (10 Gbps each) - 2 per region for HA
- 5 Edge Ports (10 Gbps each) - Toronto, LA, NYC, Stockholm, Sydney
- 25 VXCs (5 Gbps each) - Full mesh with BGP routing
- Terraform >= 1.0.0
- Megaport API credentials from portal.megaport.com → Account → API Keys
# 1. Configure
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your API credentials and location IDs
# 2. Deploy
terraform init
terraform plan
terraform applyUse the Megaport Portal or lookup by ID (more reliable than name):
data "megaport_location" "example" {
id = 61 # Equinix New York NY9
}Edit terraform.tfvars:
megaport_access_key = "your-access-key"
megaport_secret_key = "your-secret-key"
megaport_environment = "staging" # staging, production, or dev
location_ids = {
# Edge Ports
toronto = 73 # Equinix Toronto TR1
los_angeles = 59 # Equinix Los Angeles LA1
new_york = 61 # Equinix New York NY9
stockholm = 95 # Equinix Stockholm SK1
sydney = 2 # Equinix Sydney SY1
# MCRs
mcr_nam1 = 67 # Equinix Washington DC4
mcr_nam2 = 66 # Equinix San Jose SV1
mcr_europe3 = 515 # Equinix Paris PA2
mcr_europe4 = 90 # Equinix London LD5
mcr_apac5 = 560 # Equinix Tokyo TY2
mcr_apac6 = 2 # Equinix Sydney SY1
}Uses link-local addressing (169.254.x.x/31) for point-to-point links:
| Range | Usage |
|---|---|
| 169.254.10.x | NAM edge links |
| 169.254.20.x | Europe edge links |
| 169.254.30.x | APAC edge links |
| 169.254.40.x | Core backbone links |
terraform output mcr_details
terraform output edge_port_detailsCheck the Megaport Portal → Services to verify all resources show "Live" status.
terraform destroy| File | Purpose |
|---|---|
provider.tf |
Provider configuration |
variables.tf |
Variable definitions |
terraform.tfvars.example |
Example values template |
data.tf |
Location lookups |
mcr.tf |
MCR definitions + prefix filter examples |
ports.tf |
Edge port definitions |
vxc_edge.tf |
Edge-to-MCR VXCs (1-10) |
vxc_core.tf |
MCR-to-MCR backbone VXCs (11-25) |
outputs.tf |
Output definitions |