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
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.
# 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
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
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
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
megaport-cli vxc buy --json-file ./aws-vxc.json
Example aws-vxc.json with full BGP configuration:
{
"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
| Field | Required | Description |
|---|---|---|
connectType | Yes | Always "AWS" (or "AWSHC" for Hosted Connection) |
ownerAccount | Yes | Your 12-digit AWS account ID |
type | No | "private" (to VPC) or "transit" (Transit Gateway) |
connectionName | No | Display name in AWS Console |
asn | No | Your BGP ASN |
amazonAsn | No | Amazon's BGP ASN (default: 64512) |
authKey | No | BGP MD5 authentication key |
prefixes | No | CIDR blocks to advertise |
customerIPAddress | No | Your BGP peer IP (e.g. 169.254.10.1/30) |
amazonIPAddress | No | Amazon'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
# 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: CONFIGURED → LIVE
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:
- Go to AWS Console → Direct Connect → Connections
- Find the connection (it shows your
connectionNameor the Megaport VXC name) - Select it and click Accept
- Create a Virtual Interface (Private VIF for VPC access, or Transit VIF for Transit Gateway)
- 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
# 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:
# 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?
- Connect to Azure — same pattern for Azure ExpressRoute
- Port Lifecycle — manage the port your VXC connects to
- MCR Routing — add an MCR to route between AWS and other clouds
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.