全部产品
Search
文档中心

Cloud Enterprise Network:CreateTransitRouterVpnAttachment

更新时间:Dec 14, 2025

Router transit mendukung koneksi IPsec-VPN, memungkinkan data center terhubung ke router transit dan berkomunikasi dengan jaringan lain. Anda dapat memanggil operasi CreateTransitRouterVpnAttachment untuk membuat koneksi VPN.

Deskripsi operasi

  • Setelah koneksi VPN dibuat, koneksi tersebut tidak akan mempelajari rute dari atau mengasosiasikan diri dengan tabel rute mana pun pada router transit secara default.

  • Saat memanggil operasi CreateTransitRouterVpnAttachment, Anda tidak perlu menentukan TransitRouterId jika telah menentukan CenId dan RegionId. Demikian pula, Anda tidak perlu menentukan CenId jika telah menentukan TransitRouterId dan RegionId.

Prasyarat

  • Sebelum membuat koneksi VPN, pastikan Anda telah membuat koneksi IPsec-VPN di wilayah yang sama dengan instans router transit dan koneksi IPsec-VPN tersebut belum terhubung ke resource apa pun. Untuk informasi selengkapnya, lihat CreateVpnAttachment.

  • Jika instans router transit perlu terhubung ke koneksi IPsec-VPN lintas akun, pastikan instans router transit telah diberikan izin yang diperlukan atas koneksi IPsec-VPN tersebut. Untuk informasi selengkapnya, lihat GrantInstanceToTransitRouter.

  • Sebelum membuat koneksi VPN, pastikan Anda telah mengonfigurasi Blok CIDR untuk router transit. Untuk informasi selengkapnya, lihat CreateTransitRouterCidr.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

cen:CreateTransitRouterVpnAttachment

create

CenInstance

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

TransitRouter

acs:cen:*:{#accountId}:centransitrouter/{#TransitRouterId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ClientToken

string

No

Token client yang digunakan untuk memastikan idempotensi permintaan.

Buat token unik pada client Anda. Token hanya boleh berisi karakter ASCII.

Catatan

Jika Anda tidak menentukan parameter ini, sistem secara otomatis menggunakan RequestId sebagai ClientToken. RequestId untuk setiap permintaan API mungkin berbeda.

123e4567-e89b-12d3-a456-42665544****

DryRun

boolean

No

Menentukan apakah akan melakukan dry run. Nilai yang valid:

  • true: melakukan dry run tetapi tidak membuat koneksi VPN. Sistem akan memeriksa permintaan terhadap parameter yang diperlukan, format, dan batas layanan. Jika permintaan gagal dalam pemeriksaan, pesan kesalahan akan dikembalikan. Jika permintaan lolos pemeriksaan, kode kesalahan DryRunOperation akan dikembalikan.

  • false (default): melakukan dry run dan membuat koneksi VPN jika permintaan lolos pemeriksaan.

false

CenId

string

No

ID instans Cloud Enterprise Network (CEN).

cen-rsgxs8ng2awen2****

TransitRouterId

string

No

ID instans router transit.

tr-p0wm740vjnbaprv0m****

RegionId

string

No

ID wilayah tempat instans router transit ditempatkan.

Anda dapat memanggil operasi DescribeChildInstanceRegions untuk mengambil daftar wilayah terbaru.

cn-hangzhou

TransitRouterAttachmentName

string

No

Nama koneksi VPN.

Nama dapat kosong atau memiliki panjang 1 hingga 128 karakter, dan tidak boleh diawali dengan `http://` atau `https://`.

nametest

TransitRouterAttachmentDescription

string

No

Deskripsi koneksi VPN.

Deskripsi dapat kosong atau memiliki panjang 1 hingga 256 karakter, dan tidak boleh diawali dengan `http://` atau `https://`.

desctest

VpnId

string

Yes

ID koneksi IPsec-VPN.

vco-p0w042cqwvlhl4zyw****

VpnOwnerId

integer

No

ID Akun Alibaba Cloud tempat koneksi IPsec-VPN berada.

  • Jika Anda tidak menentukan parameter ini, ID Akun Alibaba Cloud saat ini akan digunakan.

  • Parameter ini wajib ditentukan jika Anda ingin terhubung ke koneksi IPsec-VPN cross-account.

1210123456123456

AutoPublishRouteEnabled

boolean

No

Menentukan apakah router transit diaktifkan untuk secara otomatis memublikasikan rute ke koneksi IPsec-VPN. Nilai yang valid:

  • true (default): diaktifkan.

  • false: dinonaktifkan.

true

ChargeType

string

No

Metode penagihan.

Nilainya diatur ke POSTPAY (default), yang menunjukkan metode penagihan bayar sesuai pemakaian.

POSTPAY

Zone

array<object>

No

ID zona di wilayah saat ini.

Sistem akan membuat resource di zona yang ditentukan.

Catatan

Jangan tentukan parameter ini jika koneksi IPsec-VPN yang disambungkan berada dalam mode dual-tunnel.

object

No

ID zona.

ZoneId

string

No

ID zona.

Anda dapat memanggil operasi ListTransitRouterAvailableResource untuk mengambil daftar zona yang tersedia.

cn-hangzhou-h

Tag

array<object>

No

Tag.

Anda dapat menentukan hingga 20 tag.

object

No

Tag.

Key

string

No

Kunci tag.

Kunci tag tidak boleh berupa string kosong. Panjangnya maksimal 64 karakter. Tidak boleh diawali dengan aliyun atau acs: dan tidak boleh mengandung http:// atau https://.

Anda dapat menentukan hingga 20 kunci tag.

TagKey

Value

string

No

Nilai tag.

Nilai tag dapat berupa string kosong atau string dengan panjang maksimal 128 karakter. Tidak boleh diawali dengan aliyun atau acs: dan tidak boleh mengandung http:// atau https://.

Anda dapat menentukan hingga 20 nilai tag.

TagValue

Elemen respons

Element

Type

Description

Example

object

Respons.

TransitRouterAttachmentId

string

ID koneksi VPN.

tr-attach-y5dup2qwfyh9lu****

RequestId

string

ID permintaan.

8B5DD40A-3A29-5AC0-B8DA-05FD10D5C893

Contoh

Respons sukses

JSONformat

{
  "TransitRouterAttachmentId": "tr-attach-y5dup2qwfyh9lu****",
  "RequestId": "8B5DD40A-3A29-5AC0-B8DA-05FD10D5C893"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 NoPermission.AliyunServiceRolePolicyForCEN You 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.
400 OperationUnsupported.TransitRouterRegionId The specified TransitRouterRegion does not support the operation.
400 InvalidCenId.NotFound CenId is not found. The error message returned because the specified CEN instance does not exist.
400 InvalidStatus.ResourceStatus The 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.
400 InvalidTransitRouterId.NotFound TransitRouterId is not found. The error message returned because the ID of the transit router does not exist.
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 InvalidTransitRouterMode.NeedUpgrade TransitRouter need to upgrade. The error message returned because the specified transit router mode is not supported.
400 InvalidAvailable.NoResource No resource in the available zone. The error message returned because resources are insufficient in the specified region.
400 OperationUnsupported.VpnAttachment The specified region does not support the operation. The error message returned because this operation is not supported in the specified region.
400 OperationUnsupported.TransitRouterType The specified TransitRouterType does not support the operation. The error message returned because this operation is not supported by the specified type of transit router.
400 OperationFailed.AllocateCidrFailed Operation failed because vpn allocate cidr failed. The error message returned because the VPN failed to apply for a CIDR block.
400 OperationUnsupported.ZoneId The specified ZoneId does not support the operation.
400 MissingParam.CenIdOrRegionId Either CenId or RegionId must be specified. The error message returned because the CenId or RegionId parameter is not set.
400 IllegalParam.RegionId RegionId is illegal. The error message returned because the specified region is invalid.
400 OperationUnsupported.CenFullLevel CEN full level does not support TransitRouter The error message returned because CEN instances of the Full type do not support Enterprise Edition transit routers.
400 InvalidOperation.CenInstanceStatus The CEN instance is not in a valid state for the operation.
400 IllegalParam.ZoneMappings The Specified Parameter ZoneMappings is illegal The error message returned because the specified zone mappings (ZoneMappings) is invalid.
400 IncorrectStatus.TransitRouter The status of TransitRouter is incorrect. The error message returned because the status of the transit router does not support this operation. Try again later.
400 InvalidOperation.VpnNetworkTypeInvalid The network type of child-instance is invalid. The error message returned because the network type specified for the instance is invalid.
400 QuotaExceeded.CenQuotaVpnAttachPerTransitRouter The maximum number of VPN attachment per Transit Router is exceeded. The error message returned because specified number of VPN attachments to the transit router exceeds the upper limit. You can submit a ticket to request a quota increase.
400 QuotaFull.ChildInstanceRelatedCen The 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.
400 Forbidden.ResourceOwnerTransitRouterServiceNotOpen The 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.
400 OperationUnsupported.VcoTunnelNotMatchZoneParam The tunnel type of the entered Vco does not match the Zone parameter. The tunnel type of the entered Vco does not match the Zone parameter.
400 Forbidden.ResourceOwnerTransitRouterServiceExpired The transit router service of the account to which the resource belongs has been suspended due to arrears. Please notify the other party to renew the service and try again. The transit router service of the account to which the resource belongs has been suspended. Please notify the other party to renew the service and try again.
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 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 IllegalParam.TransitRouterRegionId TransitRouterRegionId is illegal. The error message returned because the specified transit router region ID (TransitRouterRegionId) is invalid.
400 InvalidVpnId.NotFound The specified vpn connection instance id does not exist. The specified vpn connection instance id does not exist.
400 InvalidParameter.ResourceType The specified parameter ResourceType is invalid.
400 InvalidParameter.VpnId The specified parameter VpnId is invalid.
400 IllegalParam.ChargeType The specified ChargeType is illegal. The error message returned because the specified billing method is invalid.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.