Menu
Amazon Elastic Compute Cloud
API Reference (API Version 2016-11-15)

CreateVpcEndpoint

Creates a VPC endpoint for a specified AWS service. An endpoint enables you to create a private connection between your VPC and another AWS service in your account. You can specify an endpoint policy to attach to the endpoint that will control access to the service from your VPC. You can also specify the VPC route tables that use the endpoint.

Use DescribeVpcEndpointServices to get a list of supported AWS services.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

ClientToken

Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Type: String

Required: No

DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No

PolicyDocument

A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.

Type: String

Required: No

RouteTableId.N

One or more route table IDs.

Type: Array of strings

Required: No

ServiceName

The AWS service name, in the form com.amazonaws.region.service . To get a list of available services, use the DescribeVpcEndpointServices request.

Type: String

Required: Yes

VpcId

The ID of the VPC in which the endpoint will be used.

Type: String

Required: Yes

Response Elements

The following elements are returned by the service.

clientToken

Unique, case-sensitive identifier you provide to ensure the idempotency of the request.

Type: String

requestId

The ID of the request.

Type: String

vpcEndpoint

Information about the endpoint.

Type: VpcEndpoint object

Errors

For information about the errors that are common to all actions, see Common Errors.

Example

Example

The example creates an endpoint between vpc-1a2b3c4d and Amazon S3 in us-east-1, and associates route table rtb-11aa22bb with the endpoint.

Sample Request

Copy
https://ec2.amazonaws.com/?Action=CreateVpcEndpoint &VpcId=vpc-1a2b3c4d &ServiceName=com.amazonaws.us-east-1.s3 &RouteTableId.1=rtb-11aa22bb &AUTHPARAMS

Sample Response

Copy
<CreateVpcEndpointResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <vpcEndpoint> <vpcId>vpc-1a2b3c4d</vpcId> <state>available</state> <routeTableIdSet> <item>rtb-11aa22bb</item> </routeTableIdSet> <vpcEndpointId>vpce-abc12345</vpcEndpointId> <creationTimestamp>2015-02-20T16:46:40Z</creationTimestamp> <policyDocument>{"Version":"2008-10-17","Statement":[{"Sid":"","Effect":"Allow","Principal":"*","Action":"*","Resource":"*"}]}</policyDocument> <serviceName>com.amazonaws.us-west-1.s3</serviceName> </vpcEndpoint> <requestId>4b373100-473a-46a0-9006-example</requestId> </CreateVpcEndpointResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: