All Products
Search
Document Center

Cloud Enterprise Network:GrantInstanceToTransitRouter

Last Updated:Aug 12, 2026

Grants permissions to a transit router instance to connect to a network instance that belongs to a different account. Before a transit router instance can connect to a network instance that belongs to a different account, the network instance must authorize the transit router instance. Call the GrantInstanceToTransitRouter operation to grant the authorization.

Operation description

  • The GrantInstanceToTransitRouter operation only supports granting a transit router instance permissions to connect to cross-account Virtual Private Cloud (VPC) instances, Virtual Border Router (VBR) instances, IPsec connections, and Express Connect Router (ECR) instances.

    To grant a transit router instance permissions to connect to a Cloud Connect Network (CCN) instance, call the GrantInstanceToCbn operation.

  • Before you call the GrantInstanceToTransitRouter operation, make sure that you understand the billing rules of transit routers, the limits on authorization operations, and the prerequisites for authorization operations. For more information, see Cross-account network instance authorization.

  • Before you authorize a network instance, make sure that the following operations are completed:

    Confirm that the account to which the network instance belongs and the account to which the transit router instance belongs are of the same type.

    Obtain the Alibaba Cloud account ID to which the transit router instance belongs.

    Obtain the Cloud Enterprise Network (CEN) instance ID to which the transit router instance belongs.

    Before you authorize a VBR instance, contact your account manager to activate the VBR instance authorization feature.

    Before you authorize an IPsec connection, make sure that the IPsec connection is not associated with any resource:

    If the IPsec connection is already associated with a VPN gateway instance, it cannot be associated with a transit router instance in the same account or a different account.

    If the IPsec connection is already associated with a transit router instance, disassociate it first. For more information, see Delete a network instance connection.

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

cen:GrantInstanceToTransitRouter

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

CenId

string

Yes

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router instance belongs.

cen-44m0p68spvlrqq****

InstanceId

string

Yes

The instance ID of the network instance.

vpc-bp1h8vbrbcgohcju5****

InstanceType

string

Yes

The type of the network instance. Valid values:

  • VPC: a VPC-connected instance.

  • ExpressConnect: a VBR instance.

  • VPN: an IPsec connection.

  • ECR: an ECR instance.

VPC

RegionId

string

No

The region ID of the network instance.

You can call the DescribeChildInstanceRegions operation to query region IDs.

cn-hangzhou

CenOwnerId

integer

Yes

The Alibaba Cloud account ID to which the CEN instance belongs.

1250123456123456

OrderType

string

No

The payer of the network instance. Valid values:

  • PayByCenOwner: The fees generated by the network instance are paid by the account to which the CEN instance belongs.

  • PayByResourceOwner: The fees generated by the network instance are paid by the account to which the network instance belongs.

Valid values:

  • PayByResourceOwner :

    The account to which the network instance belongs pays the fees.

  • PayByCenOwner :

    The account to which the CEN instance belongs pays the fees.

PayByCenOwner

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

C6E5992C-A57B-5A6C-9B26-568074DC68BA

Examples

Success response

JSON format

{
  "RequestId": "C6E5992C-A57B-5A6C-9B26-568074DC68BA"
}

Error codes

HTTP status code

Error code

Error message

Description

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 NoPermission.AliyunServiceRoleForCEN You are not authorized to create the service linked role. Role Name: AliyunServiceRoleForCEN. Service Name: cen.aliyuncs.com. Make sure that the user has been granted the ram:CreateServiceLinkedRole permission. The error message because you do not have the permissions to create the service-linked role whose role name is AliyunServiceRoleForCEN and service name is cen.aliyuncs.com. You must acquire the ram:CreateServiceLinkedRole permission before you can create the service-linked role.
400 IllegalParam.CenId The specified CenId is invalid. The error message returned because the ID of the CEN instance is invalid.
400 OperationFailed.TaskConflict The operation is too frequent, please wait a moment and try again. The error message returned because this operation is performed at a high frequency. Try again later.
400 InvalidVbr.NotFound vbr is not found.
400 OperationFailed.GrantCrossAccountExist Cross-account authorization already exists. Cross-account authorization already exists.
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 Forbidden.OperateShareResource You cannot operate shared resources. You cannot operate shared resources.
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 OperationFailed.CanNotGrantVbrInstanceToCen Grant VBR instance to CEN is not supported for current VBR owner account. Grant VBR instance to CEN is not supported for current VBR owner account.
400 InvalidParameter.CenId The specified parameter CenId is invalid.
404 InvalidInstanceId.NotFound InstanceId is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.