Creates a cross-region connection on an Enterprise Edition transit router.

Description

By default, 1 Kbit/s of bandwidth is provided for cross-region communication between transit routers. This allows you to test the connectivity of cross-region IPv4 networks. To allow services that are deployed in different regions to communicate with each other, you must create a cross-region connection and allocate bandwidth resources to the connection.

Enterprise Edition transit routers allow you to allocate bandwidth resources to cross-region connections by using the following methods:

  • Allocate bandwidth resources from a bandwidth plan:

    You must purchase a bandwidth plan, and then allocate bandwidth resources from the bandwidth plan to cross-region connections. For more information, see CreateCenBandwidthPackage.

  • Use pay-by-data-transfer bandwidth resources:

    You can set a bandwidth limit for a cross-region connection. Then, you are charged for the amount of data transfer of the connection. For more information, see Cross-region data transfer.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateTransitRouterPeerAttachment

The operation that you want to perform. Set the value to CreateTransitRouterPeerAttachment.

ClientToken String No 02fb3da4-130e-11e9-8e44-001****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate a token, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

CenId String No cen-j3jzhw1zpau2km****

The ID of the Cloud Enterprise Network (CEN) instance.

TransitRouterId String No tr-bp1su1ytdxtataupl****

The ID of the local Enterprise Edition transit router.

RegionId String No cn-hangzhou

The ID of the region where the local Enterprise Edition transit router is deployed.

You can call the DescribeRegions operation to query the most recent region list.

TransitRouterAttachmentName String No testname

The name of the cross-region connection.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

TransitRouterAttachmentDescription String No testdesc

The description of the cross-region connection.

The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.

PeerTransitRouterId String Yes tr-m5eq27g6bndum7e88****

The ID of the peer transit router.

PeerTransitRouterRegionId String No cn-qingdao

The ID of the region where the peer transit router is deployed.

AutoPublishRouteEnabled Boolean No false

Specifies whether to enable the local Enterprise Edition transit router to automatically advertise the routes of the cross-region connection to the peer transit router. Valid values:

  • false (default): no
  • true: yes
Bandwidth Integer No 2

The bandwidth value of the cross-region connection. Unit: Mbit/s.

  • If you set BandwidthType to BandwidthPackage, this parameter specifies the bandwidth that is available for the cross-region connection.
  • If you set BandwidthType to DataTransfer, this parameter specifies the bandwidth limit of the cross-region connection.
CenBandwidthPackageId String No cenbwp-3xrxupouolw5ou****

The ID of the bandwidth plan that is used to allocate bandwidth to the cross-region connection.

Note If you set BandwidthType to DataTransfer, you do not need to set this parameter.
DryRun Boolean No false

Specifies whether to check the request but not perform the operation. The system checks the permissions and the status of the specified instances. Valid values:

  • false (default): checks the request. If the request passes the check, the cross-region connection is created.
  • true: checks the request but does not perform the operation. The cross-region connection is not created after the request passes the check. If you use this value, the system checks whether the required parameters are set, and whether the request syntax is valid. If the request fails the check, an error message is returned. If the request passes the check, the system returns the ID of the request.
BandwidthType String No BandwidthPackage

The method that is used to allocate bandwidth to the cross-region connection. Valid values:

BandwidthPackage: allocates bandwidth from a bandwidth plan.

DataTransfer: uses pay-by-data-transfer bandwidth.

Response parameters

Parameter Type Example Description
TransitRouterAttachmentId String tr-attach-nwkiqfvw22qesz****

The ID of the cross-region connection.

RequestId String 59422BF5-BAAD-4CFD-9019-9557BD3ACFA3

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateTransitRouterPeerAttachment
&PeerTransitRouterId=tr-m5eq27g6bndum7e88****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateTransitRouterPeerAttachmentResponse> 
<TransitRouterAttachmentId>tr-attach-nwkiqfvw22qesz****</TransitRouterAttachmentId>
<RequestId>59422BF5-BAAD-4CFD-9019-9557BD3ACFA3</RequestId>
</CreateTransitRouterPeerAttachmentResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TransitRouterAttachmentId" : "tr-attach-nwkiqfvw22qesz****",
  "RequestId" : "59422BF5-BAAD-4CFD-9019-9557BD3ACFA3"
}

Error codes

HttpCode Error code Error message Description
400 OperationUnsupported.TransitRouterRegionId The specified TransitRouterRegion does not support the operation. The error message returned because the specified region does not support the operation.
400 NoPermission.AliyunServiceRolePolicyForCEN You are not authorized to create the service linked role. Role Name: AliyunServiceRolePolicyForCEN. Service Name: cen.aliyuncs.com. Make sure that the user has been granted the ram:CreateServiceLinkedRole permission. The error message returned because you are not authorized to create the service-linked role AliyunServiceRolePolicyForCEN for the service cen.aliyuncs.com. You must acquire the ram:CreateServiceLinkedRole permission before you can perform the operation.
400 InvalidTransitRouterId.NotFound TransitRouterId is not found. The error message returned because the ID of the transit router is invalid.
400 IllegalParam.PeerTransitRouterId PeerTransitRouterId is illegal. The error message returned because the ID of the peer transit router is invalid.
400 OperationUnsupported.TransitRouterId TransitRouterId is unsupported. The error message returned because the Basic Edition transit routers do not support the operation.
400 MissingParam.Bandwidth The parameter Bandwidth is mandatory. The error message returned because no bandwidth value is specified.
400 IllegalParam.Bandwidth Bandwidth is illegal The error message returned because the specified bandwidth value is invalid.

For a list of error codes, visit the API Error Center.