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

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.


Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another AWS account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks.


Limitations and rules apply to a VPC peering connection. For more information, see the limitations section in the VPC Peering Guide.

The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected.

If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed.

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.


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


The AWS account ID of the owner of the accepter VPC.

Default: Your AWS account ID

Type: String

Required: No


The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.

Default: The Region in which you make the request.

Type: String

Required: No


The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request.

Type: String

Required: No


The ID of the requester VPC. You must specify this parameter in the request.

Type: String

Required: No

Response Elements

The following elements are returned by the service.


The ID of the request.

Type: String


Information about the VPC peering connection.

Type: VpcPeeringConnection object


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


Example 1

This example requests a peering connection between your VPC (vpc-1a2b3c4d), and a VPC (vpc-a1b2c3d4) that belongs to AWS account 123456789012.

Sample Request &VpcId=vpc-1a2b3c4d &PeerVpcId=vpc-a1b2c3d4 &PeerOwnerId=123456789012 &AUTHPARAMS

Sample Response

<CreateVpcPeeringConnectionResponse xmlns=""> <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId> <vpcPeeringConnection> <vpcPeeringConnectionId>pcx-73a5401a</vpcPeeringConnectionId> <requesterVpcInfo> <ownerId>777788889999</ownerId> <vpcId>vpc-vpc-1a2b3c4d</vpcId> <cidrBlock></cidrBlock> <peeringOptions> <allowEgressFromLocalClassicLinkToRemoteVpc>false</allowEgressFromLocalClassicLinkToRemoteVpc> <allowEgressFromLocalVpcToRemoteClassicLink>false</allowEgressFromLocalVpcToRemoteClassicLink> <allowDnsResolutionFromRemoteVpc>false</allowDnsResolutionFromRemoteVpc> </peeringOptions> </requesterVpcInfo> <accepterVpcInfo> <ownerId>123456789012</ownerId> <vpcId>vpc-a1b2c3d4</vpcId> </accepterVpcInfo> <status> <code>initiating-request</code> <message>Initiating Request to 123456789012</message> </status> <expirationTime>2014-02-18T14:37:25.000Z</expirationTime> <tagSet/> </vpcPeeringConnection> </CreateVpcPeeringConnectionResponse>

Example 2

This example requests a peering connection between your VPCs vpc-1a2b3c4d and vpc-11122233.

Sample Request &VpcId=vpc-1a2b3c4d &PeerVpcId=vpc-11122233 &AUTHPARAMS

Example 3

This example requests an inter-region peering connection between two VPCs in your account. VPC vpc-1a2b3c4d is located in the US East (N. Virginia) Region (us-east-1), and accepter VPC vpc-a1b2c3d4 is located in the US West (Oregon) Region (us-west-2). The VPC peering connection must be accepted in the us-west-2 Region.

Sample Request &VpcId=vpc-1a2b3c4d &PeerVpcId=vpc-a1b2c3d4 &PeerRegion=us-west-2 &AUTHPARAMS

See Also

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