Skip to content
Intermediate - Solutions Architect 30 minutes

Connect to AWS

Provision an AWS Direct Connect VXC using the Megaport CLI — from partner port discovery to a live private connection

Prerequisites

  • Active Megaport port in an AWS Direct Connect location
  • AWS account with Direct Connect enabled
  • AWS account ID (12-digit)

This tutorial provisions a private connection from your Megaport port to AWS via Direct Connect. You'll use the CLI to discover AWS partner ports, create the VXC, and verify the connection on both sides.

Architecture

🏢PortNextDC S1
VXC1 Gbps
🔗AWS PartnerMegaport hosted
☁️Direct Connect
🌐VPC

How it works

Megaport hosts AWS Direct Connect partner ports in co-location data centres around the world. To connect to AWS, you create a VXC from your Megaport port to one of these partner ports. AWS receives the connection request and you accept it in the AWS Console.

No cross-connect order. No hardware provisioning. No lead time.


Step 1 — Find AWS partner ports

Discover which AWS Direct Connect partner ports are available at your location.

bash
# List all AWS partner ports
megaport-cli partners list --company-name "Amazon Web Services"

# Filter to your location
megaport-cli partners list --company-name "Amazon Web Services" --location-id 3

# Filter by connection type
megaport-cli partners list --connect-type "Dedicated Cloud Connection" --location-id 3

The output shows product names and UIDs. Note the location and connect type that matches your requirements. You don't actually specify the B-End UID for cloud VXCs — Megaport routes to the correct partner port automatically via --b-end-partner-config.


Step 2 — Get your port UID

bash
megaport-cli ports list

# Filter if you have many ports
megaport-cli ports list --port-name "Sydney"
megaport-cli ports list --location-id 3

Copy the UID of the port you want to use as the A-End.


Step 3 — Create the VXC

Interactive

bash
megaport-cli vxc buy --interactive

The interactive mode walks you through A-End/B-End configuration, partner config selection, bandwidth, and term. When prompted "Do you want to configure A-End partner?" answer No (your Port doesn't need a partner block); when prompted "Do you want to configure B-End partner?" answer Yes (AWS needs connectType: "AWS"). See Partner Configurations for the full rule.

Flags

bash
megaport-cli vxc buy \
  --name "AWS Direct Connect - Sydney" \
  --a-end-uid <PORT-UID> \
  --a-end-vlan 100 \
  --rate-limit 1000 \
  --term 12 \
  --b-end-partner-config '{"connectType":"AWS","ownerAccount":"123456789012","type":"private"}'

JSON file

bash
megaport-cli vxc buy --json-file ./aws-vxc.json

Example aws-vxc.json with full BGP configuration:

json
{
  "name": "AWS Direct Connect - Sydney",
  "rateLimit": 1000,
  "term": 12,
  "aEndUid": "abc-1234-5678-def",
  "aEndVlan": 100,
  "bEndPartnerConfig": {
    "connectType": "AWS",
    "ownerAccount": "123456789012",
    "type": "private",
    "connectionName": "megaport-sydney-prod",
    "asn": 65000,
    "amazonAsn": 64512,
    "authKey": "your-bgp-password",
    "prefixes": "10.0.0.0/8",
    "customerIPAddress": "169.254.10.1/30",
    "amazonIPAddress": "169.254.10.2/30"
  }
}

AWS partner config fields

FieldRequiredDescription
connectTypeYesAlways "AWS" (or "AWSHC" for Hosted Connection)
ownerAccountYesYour 12-digit AWS account ID
typeNo"private" (to VPC) or "transit" (Transit Gateway)
connectionNameNoDisplay name in AWS Console
asnNoYour BGP ASN
amazonAsnNoAmazon's BGP ASN (default: 64512)
authKeyNoBGP MD5 authentication key
prefixesNoCIDR blocks to advertise
customerIPAddressNoYour BGP peer IP (e.g. 169.254.10.1/30)
amazonIPAddressNoAmazon's BGP peer IP (e.g. 169.254.10.2/30)
💡

Minimal config first

Start with just connectType and ownerAccount to get the connection up. You can configure BGP details on the AWS side after accepting the connection.


Step 4 — Monitor provisioning status

bash
# Check VXC details
megaport-cli vxc get <VXC-UID>

# Check just the status
megaport-cli vxc status <VXC-UID>

# Watch status in real-time
megaport-cli vxc status <VXC-UID> --watch

Status transitions: CONFIGUREDLIVE

The VXC appears as CONFIGURED immediately. Once Megaport fabric provisioning completes, it transitions to LIVE. Use --watch to auto-refresh until the transition completes.


Step 5 — Accept in AWS Console

Once the VXC is LIVE on the Megaport side:

  1. Go to AWS Console → Direct Connect → Connections
  2. Find the connection (it shows your connectionName or the Megaport VXC name)
  3. Select it and click Accept
  4. Create a Virtual Interface (Private VIF for VPC access, or Transit VIF for Transit Gateway)
  5. Configure BGP settings to match what you specified in bEndPartnerConfig

The connection is fully active once AWS shows the virtual interface state as Available.


Step 6 — Verify

bash
# Confirm VXC is live
megaport-cli vxc get <VXC-UID>

# Get output as JSON to inspect all fields
megaport-cli vxc get <VXC-UID> --output json

Clean up (optional)

To remove the connection when you're done:

bash
# Soft delete (disconnects at end of billing period)
megaport-cli vxc delete <VXC-UID>

# Immediate deletion
megaport-cli vxc delete <VXC-UID> --now
⚠️

Delete the AWS virtual interface first

Before deleting the VXC, delete the AWS Virtual Interface in the AWS Console. Deleting the VXC while the VIF exists may leave an orphaned VIF in your AWS account.


What's next?

💡

For Sales demos

AWS Direct Connect in under 10 minutes — no hardware, no cross-connect order, no waiting for AWS provisioning lead times. Run partners list --company-name "Amazon Web Services" live to show the breadth of AWS availability across Megaport locations.