All Products
Search
Document Center

Cloud Enterprise Network:ListTransitRouterVpnAttachments

Last Updated:Aug 07, 2025

You can call the ListTransitRouterVpnAttachments operation to query information about VPN connections, such as their status, IPsec-VPN connection ID, and billing method.

Operation description

The ListTransitRouterVpnAttachments operation supports the following query methods:

  • Enter only TransitRouterAttachmentId to query a specific VPN connection.

  • Enter only TransitRouterId to query all VPN connections that are associated with the specified transit router.

  • Enter CenId and RegionId to query VPN connections in a specific region of the specified Cloud Enterprise Network (CEN) instance.

When you call the ListTransitRouterVpnAttachments operation, make sure that you enter valid parameter values. If you enter invalid parameters, the system returns a RequestId but does not return the queried VPN connection information.

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:ListTransitRouterVpnAttachments

list

*CenInstance

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

TransitRouterVpnAttachment

acs:cen:*:{#accountId}:centransitrouterattachment/*

TransitRouterVpnAttachment

acs:cen:*:{#accountId}:centransitrouterattachment/{#centransitrouterattachmentId}

None None

Request parameters

Parameter

Type

Required

Description

Example

CenId

string

No

The ID of the CEN instance.

cen-rsgxs8ng2awen2****

RegionId

string

No

The ID of the region where the transit router is deployed.

For more information, see DescribeChildInstanceRegions.

cn-hangzhou

TransitRouterAttachmentId

string

No

The ID of the VPN connection.

tr-attach-a6p8voaodog5c0****

TransitRouterId

string

No

The ID of the transit router.

tr-p0wm740vjnbaprv0m****

MaxResults

integer

No

The number of entries to return on each page. Default value: 20.

20

NextToken

string

No

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, you do not need to specify this parameter.

  • If a next query is to be sent, set the value to the NextToken value returned from the last API call.

FFmyTO70tTpLG6I3FmYAXGKPd****

Tag

array<object>

No

The tags of the CEN instance.

You can query a maximum of 20 tags at a time.

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 an empty string or a string of up to 128 characters. 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.

value_A1

Response parameters

Parameter

Type

Description

Example

object

The response.

NextToken

string

The token that is used for the next query. Valid values:

  • If NextToken is empty, it indicates that no next query is to be sent.

  • If a value is returned for NextToken, the value is the token that is used for the next query.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

3D5530D2-3BBB-524E-8E98-59AB06A250E4

TotalCount

integer

The total number of entries.

1

MaxResults

integer

The number of entries returned per page.

20

TransitRouterAttachments

array<object>

A list of VPN connections.

object

The information about the VPN connection.

CreationTime

string

The time when the VPN connection was created.

The time is displayed in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format. The time is displayed in UTC.

2022-07-08T08:45Z

Status

string

The status of the VPN connection.

  • Attached: The VPN connection is attached.

  • Attaching: The VPN connection is being attached.

  • Detaching: The VPN connection is being detached.

Attached

TransitRouterAttachmentId

string

The ID of the VPN connection.

tr-attach-a6p8voaodog5c0****

TransitRouterId

string

The ID of the transit router.

tr-p0wm740vjnbaprv0m****

ResourceType

string

The resource type of the VPN connection.

The value is set to VPN, which indicates that the transit router is connected to an IPsec-VPN connection.

VPN

VpnOwnerId

integer

The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

1210123456123456

VpnId

string

The ID of the IPsec-VPN connection.

vco-p0wtu1xgd0l7fjo7k****

TransitRouterAttachmentDescription

string

The description of the VPN connection.

desctest

VpnRegionId

string

The ID of the region where the IPsec-VPN connection is deployed.

For more information, see DescribeRegions.

cn-hangzhou

AutoPublishRouteEnabled

boolean

Indicates whether the transit router automatically advertises routes to the IPsec-VPN connection. Valid values:

  • true: enabled.

  • false: disabled.

true

TransitRouterAttachmentName

string

The name of the VPN connection.

nametest

Zones

array<object>

A list of zones where the VPN connection is deployed.

object

The zone where the VPN connection is deployed.

ZoneId

string

The zone ID.

For more information, see DescribeZones.

cn-hangzhou-h

Tags

array<object>

A list of tags.

object

Key

string

The tag key.

test

Value

string

The tag value.

value_A1

ChargeType

string

The billing method of the VPN connection.

The value is set to POSTPAY, which indicates the pay-as-you-go billing method.

POSTPAY

CenId

string

The ID of the CEN instance.

cen-j3jzhw1zpau2km****

OrderType

string

The party that pays for the network instance. Valid values:

  • PayByCenOwner: The fees for the network instance are paid by the account that owns the CEN instance.

  • PayByResourceOwner: The fees for the network instance are paid by the account that owns the network instance.

PayByCenOwner

Examples

Success response

JSON format

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "3D5530D2-3BBB-524E-8E98-59AB06A250E4",
  "TotalCount": 1,
  "MaxResults": 20,
  "TransitRouterAttachments": [
    {
      "CreationTime": "2022-07-08T08:45Z",
      "Status": "Attached",
      "TransitRouterAttachmentId": "tr-attach-a6p8voaodog5c0****",
      "TransitRouterId": "tr-p0wm740vjnbaprv0m****",
      "ResourceType": "VPN",
      "VpnOwnerId": 1210123456123456,
      "VpnId": "vco-p0wtu1xgd0l7fjo7k****",
      "TransitRouterAttachmentDescription": "desctest",
      "VpnRegionId": "cn-hangzhou",
      "AutoPublishRouteEnabled": true,
      "TransitRouterAttachmentName": "nametest",
      "Zones": [
        {
          "ZoneId": "cn-hangzhou-h"
        }
      ],
      "Tags": [
        {
          "Key": "test",
          "Value": "value_A1"
        }
      ],
      "ChargeType": "POSTPAY",
      "CenId": "cen-j3jzhw1zpau2km****\n",
      "OrderType": "PayByCenOwner"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.NextToken The specified NextToken is invalid. The error message returned because the NextToken parameter is set to an invalid value.
400 IllegalParam.TrInstance The specified TransitRouter is invalid. The error message returned because the TransitRouter parameter is set to an invalid value.
400 IllegalParam.Region The specified Region is invalid. The error message returned because the specified region is invalid.
400 IllegalParam.CenId The specified CenId is invalid. The error message returned because the ID of the CEN instance is invalid.
400 IllegalParam.CenIdOrRegionId The specified CenId or RegionId is invalid. The error message returned because the specified CEN instance ID or region ID is invalid.
400 IllegalParam.TransitRouterId The specified TransitRouterId is illegal. The error message returned because the specified transit router ID is invalid.
400 IllegalParam.MaxResults The specified MaxResults is invalid.
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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.