Create Cross-region Peering Connections

Last updated: 2018-05-28 20:26:01

PDF

1. API Description

This API (CreateVpcPeeringConnectionEx) is used to create cross-regional peering connection.
Domain for API request: vpc.api.qcloud.com

1) Cross-regional peering connection is used to establish connectivity between VPCs in two different regions. The segments of the two VPCs that need to interconnect with each other cannot overlap. For more information, refer to About Peering Connection.
2) Cross-account peering connection will take effect only after the receiver accepts the request. The connection between the same accounts will take effect immediately.
3) You can set the bandwidth for cross-regional interconnection. For any changes after creation of the peering connection, please contact customer service.
4) For more information about the regions, bandwidth limit, billing methods supported for cross-regional peering connection, refer to About Peering Connection.

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is CreateVpcPeeringConnectionEx.

Parameter Name Required Type Description
vpcId Yes String ID of VPC, which can be vpcId or unVpcId. unVpcId is recommended. It can be queried through API DescribeVpcEx.
peerVpcId Yes String Receiver's VPC ID, which can be vpcId or unVpcId. unVpcId is recommended. It can be queried through API DescribeVpcEx.
peerUin Yes String Receiver's unique account ID on Tencent Cloud. You can check this in the personal information at User Center by contacting receiver. Click here to view instructions.
peeringConnectionName Yes String Peering connection name. You can specify any name you like, but its length should be limited to 60 characters.
peerRegion Yes String Receiver's region. For more information about the supported regions, refer to About Peering Connection.
bandwidth Yes String Upper limit of bandwidth for peering connection (in Mbps). There is no limit by default. For more information about the limit, refer to About Peering Connection.

3. Output Parameters

Parameter Name Type Description
code Int Error code. 0: Succeeded; other values: Failed.
message String Error message.
taskId Int Task ID. The creation result can be queried with taskId. For more information, refer to API for Querying Task Execution Result.

4. Error Codes

The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

Error Code Description
InvalidPeeringConnectionName Invalid peering connection name. It should be within 60 characters.
InvalidPeeringConnectionName.InUse The peering connection name is already in use. The peering connection name must be unique within the same VPC.
PeeringConnectionVpcConflict Conflict occurs between VPC IP address range in peering connection
PeeringConnectionLimitExceeded The limit of requested peering connection resources for the specified region has been reached. Please contact customer service for more resources. For more information on VPC resources restrictions, refer to VPC Service Limits.
InvalidVpc.NotFound VPC does not exist. Please check the information you entered.

5. Example

Input


https://vpc.api.qcloud.com/v2/index.php?Action=CreateVpcPeeringConnectionEx
&<Common request parameters>
&vpcId=gz_vpc_226
&peerVpcId=gz_vpc_89
&peerUin=2407912486
&peeringConnectionName=tses
&peerRegion=gz
&bandwidth=20

Output

{
    "code":"0",
    "message":"",
    "taskId":112245
}