Attaches an Express Connect Router (ECR) connection to the transit router in the same region.
Operation description
-
Only Enterprise Edition transit routers support ECR connections.
-
The following methods describe how to attach an ECR connection to an Enterprise Edition transit router:
- If an Enterprise Edition transit router is created in the region, specify the EcrId, RegionId, and TransitRouterId parameters.
- If no Enterprise Edition transit router is created in the region, specify the EcrId, CenId, and RegionId parameters. An Enterprise Edition transit router is automatically created when you create an ECR connection.
-
CreateTransitRouterEcrAttachment is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the ListTransitRouterEcrAttachments operation to query the status of an ECR connection.
- If the ECR connection is in the Attaching state, the ECR connection is being created. In this case, you can query the ECR connection but cannot perform other operations on the ECR connection.
- If the ECR connection is in the Attached state, the ECR connection is created.
-
After you create an ECR connection, the ECR connection is not in route learning or associated forwarding relationships with Enterprise Edition transit routers.
After you enable route learning between the ECR connection and an Enterprise Edition transit router, the routes of the ECR are automatically advertised to the route tables of the Enterprise Edition transit router.
-
After you create an ECR connection, the routes in the route tables of the Enterprise Edition transit router to which the ECR connection is attached are automatically advertised to the route table of the ECR.
Prerequisite
-
The Alibaba Cloud account of the Enterprise Edition transit router and the Alibaba Cloud account of the ECR belong to the same enterprise.
-
The Enterprise Edition transit router and ECR can belong to the same Alibaba Cloud account or different Alibaba Cloud accounts. If the Enterprise Edition transit router and ECR belong to different Alibaba Cloud accounts, grant the transit router permissions on the ECR before you can attach the ECR to the transit router. For more information, see Acquire permissions to connect to a network instance that belongs to another account.
-
Before you call this operation to attach an ECR connection to an Enterprise Edition transit router, you must call the CreateExpressConnectRouterAssociation operation to create an association between the ECR and transit router.
If you call the DeleteTransitRouterEcrAttachment operation to forcefully delete an ECR connection, the association between the ECR connection and Enterprise Edition transit router is deleted.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cen:CreateTransitRouterEcrAttachment | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
| 02fb3da4-130e-11e9-8e44-001**** |
CenId | string | No | The ID of the Cloud Enterprise Network (CEN) instance. | cen-7qthudw0ll6jmc**** |
TransitRouterId | string | No | The ID of the transit router. | tr-bp1su1ytdxtataupl**** |
RegionId | string | No | The region ID of the transit router. You can call the DescribeChildInstanceRegions operation to query the most recent region list. | eu-central-1 |
TransitRouterAttachmentName | string | No | The name of the ECR connection. The name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://. | nametest |
TransitRouterAttachmentDescription | string | No | The description of the ECR connection. This parameter is optional. If you enter a description, it must be 1 to 256 characters in length and cannot start with http:// or https://. | testdesc |
EcrId | string | Yes | The ID of the ECR. | ecr-upyc0viial107r**** |
EcrOwnerId | long | No | The ID of the Alibaba Cloud account to which the ECR belongs. By default, the ID of the current Alibaba Cloud account is specified. Note
If you want to connect to a network instance that belongs to a different account, this parameter is required.
| 1250123456123456 |
DryRun | boolean | No | Specifies whether to perform a dry run, without performing the actual request. Valid values:
| false |
Tag | array<object> | No | The tags. You can specify at most 20 tags in each call. | |
object | No | |||
Key | string | No | The tag key. The tag key cannot be an empty string. The tag key can be up to 64 characters in length. It cannot start with You can specify at most 20 tag keys in each call. | tagtest |
Value | string | No | The tag value. The tag value can be an empty string or up to 128 characters in length. It cannot start with Each key-value pair must be unique. You can specify values for at most 20 tag keys in each call. | tagtest |
Response parameters
Examples
Sample success responses
JSON
format
{
"TransitRouterAttachmentId": "tr-attach-qieks13jnt1cchy***",
"RequestId": "C0245BEF-52AC-44A8-A776-EF96FD26A5CA"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
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 do not have the permissions to create the service-linked role whose role name is AliyunServiceRolePolicyForCEN and service name is cen.aliyuncs.com. You must acquire the ram:CreateServiceLinkedRole permission before you can create the service-linked role. |
400 | OperationUnsupported.TransitRouterRegionId | The specified TransitRouterRegion does not support the operation. | - |
400 | InvalidCenId.NotFound | CenId is not found. | The error message returned because the specified CEN instance does not exist. |
400 | InvalidStatus.ResourceStatus | The resource is not in a valid state for the attachment operation. | The error message returned because the status of the specified resource does not support this operation. Try again later. |
400 | InvalidTransitRouterId.NotFound | TransitRouterId is not found. | The error message returned because the ID of the transit router does not exist. |
400 | Forbbiden.TransitRouterServiceNotOpen | The user has not open transit router service. | The error message returned because the transit router is disabled. Enable the transit router and try again. |
400 | OperationUnsupported.TransitRouterType | The specified TransitRouterType does not support the operation. | The error message returned because this operation is not supported by the specified type of transit router. |
400 | MissingParam.CenIdOrRegionId | Either CenId or RegionId must be specified. | The error message returned because the CenId or RegionId parameter is not set. |
400 | IllegalParam.AssociateRouteTableId | The specified AssociateRouteTableId is illegal. | The error message returned because the specified route table ID (AssociateRouteTableId) is invalid. |
400 | Forbbiden.AttachChildInstanceAcrossBid | Operation is invalid, please apply for cross-bid attaching. | - |
400 | IllegalParam.RegionId | RegionId is illegal. | The error message returned because the specified region is invalid. |
400 | OperationUnsupported.CenFullLevel | CEN full level does not support TransitRouter | The error message returned because CEN instances of the Full type do not support Enterprise Edition transit routers. |
400 | InvalidOperation.CenInstanceStatus | The CEN instance is not in a valid state for the operation. | - |
400 | IncorrectStatus.TransitRouter | The status of TransitRouter is incorrect. | The error message returned because the status of the transit router does not support this operation. Try again later. |
400 | QuotaFull.ChildInstanceRelatedCen | The childinstance has exceed the quota of the times that a childinstance can be attached as an attachment. | The error message returned because the number of CEN instances to which the instance is attached has reached the upper limit. You cannot attach the instance to more CEN instances. |
400 | Forbidden.ResourceOwnerTransitRouterServiceNotOpen | The resource owner user has not opened transit router service. | The transit router service for the resource owner's account is not currently opened. Please inform them to open the transit router service and then try again. |
400 | OperationUnsupported.BandwidthType | The specified BandwidthType does not support the operation. | The error message returned because this operation is not supported by the specified bandwidth type. |
400 | IllegalParam.BandwidthType | BandwidthType is illegal. | The error message returned because the specified bandwidth plan type is invalid. |
400 | IncorrectStatus.EcrResource | The ECR resource is not in a valid state for the attachment operation. | The ECR resource is not in a valid state for the attachment operation. |
400 | QuotaExceeded.CenQuotaEcrAttachPerTransitRouter | The maximum number of ECR attachment per Transit Router is exceeded. | The maximum number of ECR attachment per Transit Router is exceeded. |
400 | OperationUnsupported.ECRAttachment | ECR Attachment is not supported. | ECR Attachment is not supported. |
400 | InvalidTransitRouterMode.NeedUpgrade | TransitRouter need to upgrade. | The error message returned because the specified transit router mode is not supported. |
400 | ResourceNotFound | The resource does not found. | The resource does not found. |
400 | InvalidParameter | Invalid parameter. | The error message returned because the parameter is set to an invalid value. |
400 | Unauthorized | The AccessKeyId is unauthorized. | The error message returned because you do not have the permissions to perform this operation. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-07-10 | The Error code has changed | View Change Details |
2024-07-01 | The Error code has changed | View Change Details |