All Products
Search
Document Center

Cloud Enterprise Network:CreateTransitRouterEcrAttachment

Last Updated:Aug 07, 2025

Call the CreateTransitRouterEcrAttachment operation to connect an Express Connect Router (ECR) instance to a transit router in the same region.

Operation description

  • Only Enterprise Edition transit routers support ECR connections.

  • You can create an ECR connection on an Enterprise Edition transit router in one of the following two ways:

    • If you have an Enterprise Edition transit router instance in the destination region, you can create an ECR connection by specifying EcrId, RegionId, and TransitRouterId.

    • If you do not have an Enterprise Edition transit router instance in the destination region, you can create an ECR connection by specifying EcrId, CenId, and RegionId. When you create the ECR connection, the system automatically creates an Enterprise Edition transit router instance for you.

  • CreateTransitRouterEcrAttachment is an asynchronous operation. After you send a request, the system returns an ECR connection ID, but the connection is created in the background. You can call the ListTransitRouterEcrAttachments operation to query the status of the ECR connection.

    • If an ECR connection is in the Attaching status, the connection is being created. In this status, you can only query the connection and cannot perform other operations.

    • If an ECR connection is in the Attached status, the connection is created.

  • By default, after an ECR connection is created, it is not associated with any route table of the Enterprise Edition transit router for route learning or forwarding.

    After the ECR connection is associated with a route table of the Enterprise Edition transit router for route learning, the system automatically propagates the routes from the ECR instance to the route table of the Enterprise Edition transit router.

  • After an ECR connection is created, the system automatically propagates routes from the route table of the Enterprise Edition transit router associated with the ECR connection to the route table of the ECR instance.

Prerequisites

  • The Alibaba Cloud accounts that own the Enterprise Edition transit router and the ECR instance must belong to the same enterprise.

  • An Enterprise Edition transit router can connect to ECR instances that belong to the same account or different accounts. Before you create a cross-account ECR connection, you must obtain authorization from the account that owns the ECR instance. For more information, see Authorize a cross-account network instance.

  • Before you call this operation to create an ECR connection, you must call the CreateExpressConnectRouterAssociation operation to create an association between the ECR instance and the Enterprise Edition transit router instance.

    When you call the DeleteTransitRouterEcrAttachment operation to force delete an ECR connection, the system also deletes the association between the ECR instance and the Enterprise Edition transit router instance. You do not need to delete the association separately.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cen:CreateTransitRouterEcrAttachment

create

*CenInstance

acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}

TransitRouter

acs:cen:*:{#accountId}:centransitrouter/{#TransitRouterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ClientToken

string

No

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

Make sure that the client token is unique for each request. 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 is 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 ID of the region where the transit router is deployed.

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.

The description can be empty or 1 to 256 characters in length, and cannot start with http:// or https://.

testdesc

EcrId

string

Yes

The ID of the ECR instance.

ecr-upyc0viial107r****

EcrOwnerId

integer

No

The ID of the Alibaba Cloud account to which the ECR instance belongs. The default value is the ID of the current Alibaba Cloud account.

Note

If you want to connect to a network instance that belongs to another Alibaba Cloud account, this parameter is required.

1250123456123456

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run. The system checks the required parameters, request format, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned. The system does not change the configuration of the ECR connection.

  • false (default): sends a normal request. If the request passes the check, the system changes the configuration of the ECR connection.

false

Tag

array<object>

No

The tags.

You can specify up to 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 and cannot start with aliyun or acs:. It cannot contain http:// or https:// .

You can specify up to 20 tag keys.

tagtest

Value

string

No

The tag value.

The tag value can be empty or up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https:// .

Each tag key must have a unique tag value. You can specify up to 20 tag values.

tagtest

Response parameters

Parameter

Type

Description

Example

object

TransitRouterAttachmentId

string

The ID of the ECR connection.

tr-attach-qieks13jnt1cchy***

RequestId

string

The request ID.

C0245BEF-52AC-44A8-A776-EF96FD26A5CA

Examples

Success response

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 Forbidden.ResourceOwnerTransitRouterServiceExpired The transit router service of the account to which the resource belongs has been suspended due to arrears. Please notify the other party to renew the service and try again. The transit router service of the account to which the resource belongs has been suspended. Please notify the other party to renew the service and try again.
400 Forbidden.TransitRouterServiceExpired The transit router service is out of service. The transit router service has been suspended due for payment. Please renew the service and try again.
400 Forbbiden.AttachAcrossBidEcr Attach cross bid ECR is unsupported. Please submit a ticket. Attach cross bid ECR is unsupported. Please submit a ticket.
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.
400 InvalidParameter.ResourceType The specified parameter ResourceType is invalid.
400 SystemBusy The system is busy. Please try again later. The error message returned because the system is unavailable. Try again later.
400 OperationDenied.AttachmentInCurrentRegionExisted The current operation is rejected. The Express Connect Router instance can only associate one Transit Router in the same region.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.