All Products
Search
Document Center

Express Connect:CreateExpressConnectRouterAssociation

Last Updated:Sep 24, 2026

Associates a virtual private cloud (VPC) or transit router (TR) with an Express Connect Router (ECR).

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 supports 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

expressconnectrouter:CreateExpressConnectRouterAssociation

none

*ExpressConnectRouter

acs:expressconnectrouter::{#accountId}:expressconnectrouter/{#EcrId}

None None

Request parameters

Parameter

Type

Required

Description

Example

EcrId

string

Yes

The Express Connect Router (ECR) instance ID.

ecr-mezk2idmsd0vx2****

AssociationRegionId

string

Yes

The region to which the associated resource belongs.

cn-hangzhou

TransitRouterOwnerId

integer

No

The Alibaba Cloud account ID of the account that owns the transit router instance. Default value: the Alibaba Cloud account ID of the current logon account.

Note

This parameter is required if you want to load a network instance that belongs to a different account.

189159362009****

TransitRouterId

string

No

The ID of the transit router.

Note

The TransitRouterId and VpcId parameters are mutually exclusive. You must specify one of them. Create a transit router by calling the CreateTransitRouter API of the Cbn(2017-09-12) product and obtain the TransitRouterId.

tr-2ze4i71c6be454e2l****

CenId

string

No

The Cloud Enterprise Network (CEN) instance ID.

Note

CenId is required when TransitRouterId is specified. Create a CEN instance by calling the CreateCen API of the Cbn(2017-09-12) product and obtain the CenId.

cen-of3o1the3i4gwb****

VpcOwnerId

integer

No

The Alibaba Cloud account ID of the account that owns the VPC-connected instance. Default value: the Alibaba Cloud account ID of the current logon account.

Note

This parameter is required if you want to load a network instance that belongs to a different account.

132193271328****

VpcId

string

No

The VPC-connected instance ID.

Note

The VpcId and TransitRouterId parameters are mutually exclusive. You must specify one of them. Create a VPC by calling the CreateVpc API of the Vpc(2016-04-28) product and obtain the VpcId.

vpc-bp1h37fchc6jmfyln****

AllowedPrefixes

array

No

The list of allowed prefix routes.

string

No

The allowed prefix route.

192.0.20.0/24

CreateAttachment

boolean

No

Specifies whether to initiate the association when the ECR is attached to a TR. Valid values:

  • true: The association does not need to be initiated from the transit router side.

  • false: The association needs to be initiated from the transit router side.

true

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: Performs a dry run. The system checks the request for potential issues without modifying any EPS resources.

  • false (default): Sends the request as normal.

false

ClientToken

string

No

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

Generate a parameter value from your client to ensure uniqueness across different requests. ClientToken supports only ASCII characters.

Note

If you do not specify this parameter, the system uses the RequestId of the API request as the ClientToken. The RequestId may be different for each API request.

02fb3da4-130e-11e9-8e44-00****

AllowedPrefixesMode

string

No

The prefix route mode. Valid values:

  • MatchMode: match mode. Only the configured route CIDR blocks are advertised to the IDC, and previously advertised specific routes are withdrawn.

  • IncrementalMode: incremental mode. The configured route CIDR blocks are advertised to the IDC. Previously advertised specific routes that fall within the configured CIDR blocks are withdrawn, while specific routes that do not fall within the configured CIDR blocks remain advertised.

MatchMode

Description

string

No

The description of the associated resource. The description must be 0 to 128 characters in length.

test

Tag

array<object>

No

The list of tags.

You can bind up to 20 tags.

object

No

Key

string

No

The tag key of the resource. If you specify this parameter, the value cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

TestKey

Value

string

No

The tag value of the resource. The tag value can be an empty string and can be up to 128 characters in length. It cannot contain http:// or https://.

TestValue

Response elements

Element

Type

Description

Example

object

RpcResponse

AccessDeniedDetail

string

The details about the access denial.

Authentication is failed for ****

AssociationId

string

The associate ID between the Express Connect Router (ECR) and the VPC or TR.

ecr-assoc-9p2qxx5phpca2m****

Code

string

The response code. A value of 200 indicates that the association was successful. Other values indicate failure. For more information, see error codes.

200

DynamicCode

string

The dynamic error code.

IllegalParamFormat.EcrId

DynamicMessage

string

The dynamic error message, which is used to replace the %s placeholder in the ErrMessage parameter.

Note

If ErrMessage returns The Value of Input Parameter %s is not valid and DynamicMessage returns DtsJobId, the value of the request parameter DtsJobId is invalid.

The param format of EcrId **** is illegal.

HttpStatusCode

integer

The HTTP status code.

200

Message

string

The returned message.

OK

RequestId

string

The request ID.

05130E79-588D-5C40-A718-C4863A59****

Success

boolean

Indicates whether the call was successful. Valid values:

  • True: The call was successful.

  • False: The call failed.

True

Examples

Success response

JSON format

{
  "AccessDeniedDetail": "Authentication is failed for ****\n",
  "AssociationId": "ecr-assoc-9p2qxx5phpca2m****",
  "Code": "200",
  "DynamicCode": "IllegalParamFormat.EcrId\n",
  "DynamicMessage": "The param format of EcrId **** is illegal.\n",
  "HttpStatusCode": 200,
  "Message": "OK",
  "RequestId": "05130E79-588D-5C40-A718-C4863A59****",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 IncorrectStatus.Ecr Ecr Status does not allow current operation. The status of the express connect gateway instance does not allow the current operation. Currently, other operations are being performed or the express connect gateway instance is being deleted. Please try again later.
400 OperationDenied.ForceDeleting The current instance is being deleted. Your current operation is rejected and the leased line gateway instance is being forcibly deleted. Please try again later.
400 UnsupportedRegion Feature not supported in specified region. The specified region does not support the leased line gateway function.
400 QuotaExceeded.VpcCountPerEcr The number of VPC bound to the ECR exceeds the quota. The number of VPCs that can be bound to a dedicated gateway instance has reached the quota limit. Please contact your business manager to apply for a larger quota.
400 QuotaExceeded.TrCountPerEcr The number of TR bound to the ECR exceeds the quota. The number of TRs that can be bound to a dedicated gateway instance has reached the quota limit. Please contact your business manager to apply for a larger quota.
400 IllegalParamFormat.AllowedPrefixes The prefix parameter format is invalid. Procedure. The format of the specified prefix route segment is incorrect.
400 OperationDenied.NotGrantedByNodeOwner The node owner is not authorized. Your current operation is rejected, and the leased line gateway product is not authorized.
400 OperationFailed.CdtNotOpened The Cdt function is disabled. The current operation fails, and the Alibaba Cloud data transmission function is not enabled.
400 OperationFailed.CdtCrossBoarderNotOpened The Cdt cross-border transmission function is disabled. The current operation fails. The cross-border data transmission function of Alibaba Cloud is not enabled.
400 OperationFailed.CrossBorderNotAllowed There is no qualification for creating cross-border links. The operation failed. The current enterprise does not have the permission to create cross-border links. Please contact your business manager to add this permission.
400 ResourceNotFound.CenId CenId not found. Cen instance does not exist
400 ResourceNotFound.TrId TRId not found. TR instance does not exist
400 Conflict.ASNOfVBR ASN already used by other VBR. The current VBR BgpGroup localAsn is inconsistent with the ECR asn. Adjust the consistency and rebind.
400 MissingParam.%s The param of %s is missing. The request parameters are not specified. Please check the corresponding parameters and try again.
400 IllegalParamFormat.%s The param format of %s is illegal. Illegal parameter format
400 IllegalParamFormat.CenId The format of the entered Cen instance ID is incorrect. The format of the currently entered Cen instance ID is incorrect
400 OperationDenied.CrossBidAssociating Cross-border binding of resources is subject to compliance constraints. Your current binding resources involve cross-Chinese site resources and overseas site resources. Due to compliance constraints, please contact your business manager for communication and handling.
400 ExclusiveParam.TransitRouterIdAndVpcId A private network instance cannot be bound to a forwarding router instance at the same time. The VPC instance and the forwarding router instance cannot be bound at the same time, please select one of the instances to bind after adjustment.
400 IllegalParamSize.AllowedPrefixes The number of prefix routes exceeded the quota. The number of prefix routes you have entered exceeds the quota. Please apply for expansion.
400 OperationDenied.CrossAccountAttaching If the forwarding router is bound to another account, perform this operation on the same account. The current operation is rejected. When you bind another account to the forwarding router, you need to do this operation under this account.
400 OperationDenied.AttachmentInCurrentRegionExisted Only one forwarding router can be bound to an area. The current operation is rejected. The leased line gateway instance can only bind one forwarding router in the same region.
400 Conflict.Lock There are other unfinished operations. You currently have other unfinished operations, please try again later
400 OperationFailed.CallingVpcYaochi The system is abnormal. Please try again later. The operation failed and the system is abnormal. Please try again later. If the retry still fails, please contact your business manager for help.
400 ResourceAlreadyExist.TransitRouterId The specified resource of transit router already exists. The specified TR resource has been associated with the leased line gateway ECR. Check and try again.
400 ResourceAlreadyExist.VpcId The specified resource of VpcId already exists. The specified VPC resource has been associated with the leased line gateway ECR. Please check and try again.
400 Conflict.AllowedPrefixes The allowed route prefixes [%s] is conflict. The currently configured AllowedPrefixes already exists. Please confirm and submit it again.
400 UnsupportedFeature.JumboFrame The region where the sub-instance is located does not support the jumbo frame feature and cannot be attached to the express connect router. The region where the sub-instance is located does not support the jumbo frame feature and cannot be attached to the express connect router.
400 InternalErrorTemp The request processing has failed due to some unknown error. The request processing has failed due to some unknown error.
400 OperationFailed.AlreadyExistPropagationSource The operation failed because an existing propagation source is already configured for the instance. The instance already has a route propagation source and cannot be repeatedly loaded to the ECR.
400 OperationFailed.CloudBoxVSwitchExist The operation failed because the VPC contains a CloudBox vSwitch. There is a cloud box (CloudBox) switch in the VPC, which cannot be attached to the ECR.
400 OperationFailed.CloudBoxVbrExist The operation is not allowed because a CloudBox VBR already exists on this ECR association. The cloud box VBR already exists on the association, and the operation cannot be continued.
400 OperationFailed.NoRouteTableInVpc The operation failed because no system route table is found in the VPC. No system route table was found in the VPC. The association cannot be established.
400 OperationFailed.TrServiceNotOpened The operation is not allowed because the Transit Router service is not opened. The Transit Router (TR) service has not been activated. Please activate it first and try again.
400 OperationFailed.TrServiceExpired The operation is not allowed because the Transit Router service has expired. The Transit Router (TR) service has expired/is overdue. Please renew and try again.
400 IncorrectStatus.Vpc The status of the VPC is incorrect. The current status of the VPC does not support this operation. Wait until the VPC returns to a stable state and try again.
400 IncorrectStatus.VpcOperating The VPC is operating and does not support this operation. The VPC is performing another operation. Wait for the operation to complete and try again.
400 IncorrectStatus.Vswitch The status of the vSwitch is incorrect. The current state of the switch does not support this operation. Please wait until the switch returns to a stable state and try again.
400 IncorrectStatus.RouteEntry The status of the route entry is incorrect. The current status of the route entry does not support this operation. Wait until the route entry returns to a stable state and try again.
400 OperationDenied.ViolateRegionMutuallyExclusive The operation is not allowed because the region violates the mutually exclusive constraint. The operation is not allowed because the region violates the mutually exclusive constraint.
404 ResourceNotFound.EcrId EcrId not found. ECR instance does not exist

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.