Creating a VXC to AWS with the API

This topic steps through the API procedure to create a VXC to a AWS, including how to look up cloud interconnect locations, validate the connection, and order the VXC.

The example in this topic creates a Hosted VIF connection to AWS with a data rate of 500 Mbps. To step through this example, use the staging environment URL, which lets you configure the connections but does not deploy or charge for the services.

Tip

To see all options for the requests used in this example, see https://dev.megaport.com

To look up cloud provider location details in the Postman collection

  1. Expand Lists for Ordering in the left navigation and click GET Partner Megaports.

  2. Click Send to make a GET request to the API server.

    GET {API Server URL}/v2/dropdowns/partner/megaports
    

    This request returns all the interfaces Megaport has with Cloud Service Providers. You can search by clicking the magnifying glass and entering a location, data center, or other parameter in the search field.

    The connectType indicates the Cloud Service Provider. AWS includes “AWS” for Hosted VIFs and “AWSHC” for Hosted Connections.

    You can filter the results by connectType and vxcPermitted.

    GET {API Server URL}/v2/dropdowns/partner/megaports?connectType=AWS&vxcPermitted=true
    

    This example uses a Port in Interxion DUB2 that is accepting VXCs (“vxcPermitted”: true) and is in the region eu-west-1.

      {
            "connectType": "AWS",
            "productUid": "6cc21ccb-5ecc-4869-ab0e-b3fa17f5110f",
            "vxcPermitted": true,
            "companyUid": "623cb950-abb4-4b07-b372-8cf55756c322",
            "companyName": "AWS",
            "title": "EU (Ireland) (eu-west-1)",
            "locationId": 96,
            "speed": 10000,
            "rank": 61,
            "lag_id": 2,
            "lag_primary": true,
            "aggregation_id": 54188
        },

To test and validate the order

  1. In Postman, expand API Orders in the left navigation and select Validate AWS.

  2. Update the Body of the request with the productUid of the Port, the productUid of the AWS port, and the AWS account ID.

    You can also change additional values, such as name, rate limit, VLAN ID, ASN values, authKey, and IP addressing.

  3. Click Send to POST the request.

    POST {API Server URL}/v2/networkdesign/validate
    
[
    {
        "productUid": "a49cf3f1-20a1-4390-93aa-5005bdafe3d7", 
        "associatedVxcs": [
            {
                "productName": "My Amazon Direct Connect",
                "rateLimit": "500",
                "aEnd": {
                    "vlan": 777
                },
                "bEnd": {
                    "productUid": "6cc21ccb-5ecc-4869-ab0e-b3fa17f5110f", 
                    "partnerConfig": {
                        "connectType": "AWS",
                        "name": "Amazon name for service",
                        "type": "private",
                        "asn": 65105,
                        "amazonAsn": 64555,
                        "ownerAccount": "312345679135",
                        "authKey": "123456",
                        "prefixes": "10.0.1.0/24",
                        "customerIpAddress": null,
                        "amazonIpAddress": null
                    }
                }
            }
        ]
    }
]

When validated, you are ready to place the VXC order.

To order the VXC to AWS

  1. Copy the validated body from the POST Validate AWS and paste into the body of the POST Buy AWS.

  2. Click Send to post the request.

    POST {API Server URL}/v2/networkdesign/buy
    

Here is an example of a successful response.

{
    "message": "VXC [47d6cc4d-6a1a-4301-b06c-cebb5f9b8f3e] created. ",
    "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
    "data": [
        {
            "createDate": 1588868593704,
            "vxcOrderId": 42328,
            "payerMegaPortId": 68124,
            "nonPayerMegaPortId": 52786,
            "payerMegaPortName": "API Port",
            "nonPayerMegaPortName": "EU (Ireland) (eu-west-1)",
            "payerCompanyId": 2278,
            "nonPayerCompanyId": 117,
            "payerLocationId": 89,
            "nonPayerLocationId": 96,
            "salesId": null,
            "payerCompanyName": "Megaport Lab",
            "nonPayerCompanyName": "AWS",
            "payerMegaPortNsId": 138231,
            "nonPayerMegaPortNsId": 221182,
            "payerVlanId": 777,
            "nonPayerVlanId": 0,
            "payerApproverName": "Paul McGuinness",
            "payerApproverId": 12695,
            "nonPayerApproverName": "Paul McGuinness",
            "nonPayerApproverId": 12684,
            "payerApproval": 1582268553574,
            "nonPayerApproval": 1228868693614,
            "fixedTerm": true,
            "duration": 1,
            "rollover": true,
            "serviceName": "from API Port to EU (Ireland) (eu-west-1)",
            "payerStatus": "APPROVED",
            "nonPayerStatus": "APPROVED",
            "speed": 500,
            "distanceBand": "ZONE",
            "intercapPath": "",
            "awsId": null,
            "promoCode": null,
            "rateType": "MONTHLY",
            "vxcJTechnicalServiceId": 57115,
            "vxcJTechnicalServiceUid": "47d6cc4d-6a1a-4301-b06c-cebb5f9b8f3e",
            "provisionDate": 1588868593517,
            "orderType": "NEW",
            "monthlyDiscountAmount": null,
            "discountMonths": null,
            "amazonDirectConnectConfigDto": {
                "type": "private",
                "asn": 65105,
                "ownerAccount": "312345679135",
                "authKey": "123456",
                "customerIpAddress": null,
                "amazonIpAddress": null,
                "prefixes": "10.0.1.0/24",
                "name": "Amazon name for service"
            },
            "amsixConnectConfigDto": null,
            "webAirProvItem": null,
            "sdrcProvItem": null,
            "rate": null,
            "setup": null,
            "asn": null,
            "bgpPassword": null,
            "usageAlgorithm": "POST_PAID_HOURLY_SPEED_LONG_HAUL_VXC",
            "costCentre": null,
            "azureServiceKey": null,
            "oracleVirtualCircuitId": null,
            "serviceKey": null,
            "connectType": "AWS",
            "payerConfig": {},
            "nonPayerConfig": {},
            "attributeTags": {},
            "fullyApproved": true
        }
    ]
}

The Port and VXC now appear in the Megaport Portal.

Portal view of API port and VXC

For this example, the AWS Hosted VIF will appear in the AWS portal account under Direct Connect - Virtual Interfaces. The account holder can accept the Virtual Interface and connect it to a Virtual Private Gateway or a Direct Connect Gateway and then to their VPCs.


Last update: