All Products
Search
Document Center

Cloud Enterprise Network:CreateTransitRouterEcrAttachment

Last Updated:Oct 22, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
cen:CreateTransitRouterEcrAttachmentcreate
  • CenInstance
    acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}
  • TransitRouter
    acs:cen:*:{#accountId}:centransitrouter/{#TransitRouterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

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****
CenIdstringNo

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

cen-7qthudw0ll6jmc****
TransitRouterIdstringNo

The ID of the transit router.

tr-bp1su1ytdxtataupl****
RegionIdstringNo

The region ID of the transit router.

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

eu-central-1
TransitRouterAttachmentNamestringNo

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
TransitRouterAttachmentDescriptionstringNo

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
EcrIdstringYes

The ID of the ECR.

ecr-upyc0viial107r****
EcrOwnerIdlongNo

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
DryRunbooleanNo

Specifies whether to perform a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, 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.
  • false (default): performs a dry run and performs the actual request.
false
Tagarray<object>No

The tags.

You can specify at most 20 tags in each call.

objectNo
KeystringNo

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 aliyun or acs: and cannot contain http:// or https://.

You can specify at most 20 tag keys in each call.

tagtest
ValuestringNo

The tag value.

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

Each key-value pair must be unique. You can specify values for at most 20 tag keys in each call.

tagtest

Response parameters

ParameterTypeDescriptionExample
object
TransitRouterAttachmentIdstring

The ID of the ECR connection.

tr-attach-qieks13jnt1cchy***
RequestIdstring

The request ID.

C0245BEF-52AC-44A8-A776-EF96FD26A5CA

Examples

Sample success responses

JSONformat

{
  "TransitRouterAttachmentId": "tr-attach-qieks13jnt1cchy***",
  "RequestId": "C0245BEF-52AC-44A8-A776-EF96FD26A5CA"
}

Error codes

HTTP status codeError codeError messageDescription
400NoPermission.AliyunServiceRolePolicyForCENYou 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.
400OperationUnsupported.TransitRouterRegionIdThe specified TransitRouterRegion does not support the operation.-
400InvalidCenId.NotFoundCenId is not found.The error message returned because the specified CEN instance does not exist.
400InvalidStatus.ResourceStatusThe 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.
400InvalidTransitRouterId.NotFoundTransitRouterId is not found.The error message returned because the ID of the transit router does not exist.
400Forbbiden.TransitRouterServiceNotOpenThe user has not open transit router service.The error message returned because the transit router is disabled. Enable the transit router and try again.
400OperationUnsupported.TransitRouterTypeThe specified TransitRouterType does not support the operation.The error message returned because this operation is not supported by the specified type of transit router.
400MissingParam.CenIdOrRegionIdEither CenId or RegionId must be specified.The error message returned because the CenId or RegionId parameter is not set.
400IllegalParam.AssociateRouteTableIdThe specified AssociateRouteTableId is illegal.The error message returned because the specified route table ID (AssociateRouteTableId) is invalid.
400Forbbiden.AttachChildInstanceAcrossBidOperation is invalid, please apply for cross-bid attaching.-
400IllegalParam.RegionIdRegionId is illegal.The error message returned because the specified region is invalid.
400OperationUnsupported.CenFullLevelCEN full level does not support TransitRouterThe error message returned because CEN instances of the Full type do not support Enterprise Edition transit routers.
400InvalidOperation.CenInstanceStatusThe CEN instance is not in a valid state for the operation. -
400IncorrectStatus.TransitRouterThe status of TransitRouter is incorrect.The error message returned because the status of the transit router does not support this operation. Try again later.
400QuotaFull.ChildInstanceRelatedCenThe 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.
400Forbidden.ResourceOwnerTransitRouterServiceNotOpenThe 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.
400OperationUnsupported.BandwidthTypeThe specified BandwidthType does not support the operation.The error message returned because this operation is not supported by the specified bandwidth type.
400IllegalParam.BandwidthTypeBandwidthType is illegal.The error message returned because the specified bandwidth plan type is invalid.
400IncorrectStatus.EcrResourceThe 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.
400QuotaExceeded.CenQuotaEcrAttachPerTransitRouterThe maximum number of ECR attachment per Transit Router is exceeded.The maximum number of ECR attachment per Transit Router is exceeded.
400OperationUnsupported.ECRAttachmentECR Attachment is not supported.ECR Attachment is not supported.
400InvalidTransitRouterMode.NeedUpgradeTransitRouter need to upgrade.The error message returned because the specified transit router mode is not supported.
400ResourceNotFoundThe resource does not found.The resource does not found.
400InvalidParameterInvalid parameter.The error message returned because the parameter is set to an invalid value.
400UnauthorizedThe 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 timeSummary of changesOperation
2024-07-10The Error code has changedView Change Details
2024-07-01The Error code has changedView Change Details