Amazon API Gateway REST API Reference

Creates a VPC link, under the caller's account in a selected region, in an asynchronous operation that typically takes 2-4 minutes to complete and become operational. The caller must have permissions to create and update VPC Endpoint services.

HTTP Request

POST /vpclinks

Request Body

{
  "name" : "String",
  "description" : "String",
  "targetArns" : [ "String" ]
}

Request Body Fields

The request accepts the following fields in JSON format.

  • name
  • [Required] The name used to label and identify the VPC link.

  • description
  • The description of the VPC link.

  • targetArns
  • [Required] The ARNs of network load balancers of the VPC targeted by the VPC link. The network load balancers must be owned by the same AWS account of the API owner.

Response

VpcLink

Remarks

Before creating a VpcLink, you must have a network load balancer running in the region where you create the VpcLink and have obtained the ARN of the network load balancer.

Example

The following example creates a VpcLink in the us-east-1 region:

Request

POST /vpclinks HTTP/1.1
Content-Type: application/json
Host: apigateway.us-eas-t.amazonaws.com
Content-Length: ...
X-Amz-Date: 20160801T235803Z
Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/20160801/ap-southeast-1/apigateway/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature={sigv4_hash}

{
    "name":"my-test-vpc-link",
    "targetArns": ["arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/net/my-vpclink-test-nlb/1f8df693cd094a72"]
}
Response

The successful response returns a 202 Accepted status code and a payload similar to the following.

{    "id": "gim7c3",
    "name": "my-test-vpc-link",
    "status": "PENDING",
    "targetArns": "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/net/my-vpclink-test-nlb/1f8df693cd094a72"
}

Because the operation is asynchronous, the successful status code is 202 and the resulting VpcLink's status is PENDING. You must wait for the status to become AVAILABLE before integrating it with an API method. Note the returned VpcLink id value. You will need it to inspect the status of the resulting VpcLink.

See Also

Getting Started with Private Integrations, Set up Private Integrations