All Products
Search
Document Center

Cloud Enterprise Network:ListTransitRouterVpnAttachments

Last Updated:Jul 23, 2026

Queries information about VPN connections, such as the status, IPsec connection ID, and billing method of VPN connections.

Operation description

The ListTransitRouterVpnAttachments operation supports the following three query methods:

  • Specify only TransitRouterAttachmentId to query information about a specific VPN connection.

  • Specify only TransitRouterId to query information about all VPN connections associated with the specified transit router.

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

When calling the ListTransitRouterVpnAttachments operation, make sure that the parameter values are correct. If you specify incorrect parameter values, the response still returns a RequestId, but does not include the information about the target VPN connections.

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: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 Cloud Enterprise Network (CEN) instance ID.

cen-rsgxs8ng2awen2****

RegionId

string

No

The region ID of the transit router instance.

You can call the DescribeChildInstanceRegions operation to query region IDs.

cn-hangzhou

TransitRouterAttachmentId

string

No

The ID of the VPN connection.

tr-attach-a6p8voaodog5c0****

TransitRouterId

string

No

The transit router instance ID.

tr-p0wm740vjnbaprv0m****

MaxResults

integer

No

The number of entries per page for a paged query. Default value: 20.

20

NextToken

string

No

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request or if no next query exists.

  • If a next query exists, set the value to the NextToken value returned by the previous API call.

FFmyTO70tTpLG6I3FmYAXGKPd****

Tag

array<object>

No

The tag information of the CEN instance.

You can query up to 20 tags at a time.

object

No

Key

string

No

The tag key of the resource.

The tag key cannot be an empty string. It 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 at a time.

tagtest

Value

string

No

The tag value of the resource.

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

Each tag key corresponds to one tag value. You can specify up to 20 tag values at a time.

value_A1

Response elements

Element

Type

Description

Example

object

The response parameters.

NextToken

string

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next query exists.

  • If NextToken is returned, the value indicates the token for the next query.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

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

TotalCount

integer

The total number of entries returned.

1

MaxResults

integer

The number of entries per page in a paged query. This is used for paging the results.

20

TransitRouterAttachments

array<object>

The list of VPN connections.

array<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: attached.

  • Attaching: being attached.

  • Detaching: being detached.

Attached

TransitRouterAttachmentId

string

The ID of the VPN connection.

tr-attach-a6p8voaodog5c0****

TransitRouterId

string

The transit router instance ID.

tr-p0wm740vjnbaprv0m****

ResourceType

string

The resource type of the VPN connection.

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

VPN

VpnOwnerId

integer

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

1210123456123456

VpnId

string

The ID of the IPsec connection.

vco-p0wtu1xgd0l7fjo7k****

TransitRouterAttachmentDescription

string

The description of the VPN connection.

desctest

VpnRegionId

string

The region ID of the IPsec connection.

You can call the DescribeRegions operation to query region IDs.

cn-hangzhou

AutoPublishRouteEnabled

boolean

Indicates whether the transit router instance is allowed to automatically publish route entries to the IPsec connection. Valid values:

  • true: allowed.

  • false: not allowed.

true

TransitRouterAttachmentName

string

The name of the VPN connection.

nametest

Zones

array<object>

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

The 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 POSTPAY only, which indicates pay-as-you-go.

POSTPAY

CenId

string

The Cloud Enterprise Network (CEN) instance ID.

cen-j3jzhw1zpau2km****

OrderType

string

The payer of the VPN connection. 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.

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. The MaxResults value 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.