Requests a VPC peering connection between two VPCs: a requester VPC that you own and a peer VPC with which to create the connection. The peer VPC can belong to another AWS account. The requester VPC and peer VPC cannot have overlapping CIDR blocks.
The owner of the peer 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 try to create a VPC peering connection between VPCs that have overlapping CIDR
blocks, the VPC peering connection status goes to
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
The AWS account ID of the owner of the peer VPC.
Default: Your AWS account ID
The ID of the VPC with which you are creating the VPC peering connection.
The ID of the requester VPC.
The following elements are returned by the service.
The ID of the request.
Information about the VPC peering connection.
Type: VpcPeeringConnection object
For information about the errors that are common to all actions, see Common Errors.
This example requests a peering connection between your VPC
vpc-1a2b3c4d), and a VPC (
vpc-a1b2c3d4) that belongs to AWS
https://ec2.amazonaws.com/?Action=CreateVpcPeeringConnection &VpcId=vpc-1a2b3c4d &PeerVpcId=vpc-a1b2c3d4 &PeerOwnerId=123456789012 &AUTHPARAMS
<CreateVpcPeeringConnectionResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId> <vpcPeeringConnection> <vpcPeeringConnectionId>pcx-73a5401a</vpcPeeringConnectionId> <requesterVpcInfo> <ownerId>777788889999</ownerId> <vpcId>vpc-vpc-1a2b3c4d</vpcId> <cidrBlock>10.0.0.0/28</cidrBlock> <peeringOptions> <allowEgressFromLocalClassicLinkToRemoteVpc>false</allowEgressFromLocalClassicLinkToRemoteVpc> <allowEgressFromLocalVpcToRemoteClassicLink>false</allowEgressFromLocalVpcToRemoteClassicLink> </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>
This example requests a peering connection between your VPCs
https://ec2.amazonaws.com/?Action=CreateVpcPeeringConnection &VpcId=vpc-1a2b3c4d &PeerVpcId=vpc-11122233 &AUTHPARAMS
For more information about using this API in one of the language-specific AWS SDKs, see the following: