全部产品
Search
文档中心

Cloud Enterprise Network:CreateTransitRouterVpcAttachment

更新时间:Dec 14, 2025

Menyambungkan virtual private cloud (VPC) yang ingin Anda hubungkan ke router transit. Setelah VPC tersebut terhubung ke router transit yang sama, VPC-VPC tersebut dapat saling berkomunikasi.

Deskripsi operasi

  • Anda dapat menggunakan metode berikut untuk membuat koneksi VPC dari router transit edisi perusahaan:

    • Jika router transit edisi perusahaan telah dibuat di wilayah tempat Anda ingin membuat koneksi VPC, konfigurasikan parameter VpcId, ZoneMappings.N.VSwitchId, ZoneMappings.N.ZoneId, TransitRouterId, dan RegionId.

    • Jika belum ada router transit edisi perusahaan di wilayah tersebut, konfigurasikan parameter VpcId, ZoneMappings.N.VSwitchId, ZoneMappings.N.ZoneId, CenId, dan RegionId. Sistem akan secara otomatis membuat router transit edisi perusahaan di wilayah yang ditentukan.

  • CreateTransitRouterVpcAttachment merupakan operasi asinkron. Setelah permintaan dikirim, sistem mengembalikan ID permintaan dan menjalankan tugas di latar belakang. Anda dapat memanggil operasi ListTransitRouterVpcAttachments untuk memeriksa status koneksi VPC.

    • Jika status koneksi VPC adalah Attaching, koneksi tersebut sedang dalam proses pembuatan. Anda dapat memeriksa statusnya, tetapi tidak dapat melakukan operasi lain.

    • Jika status koneksi VPC adalah Attached, koneksi VPC telah berhasil dibuat.

  • Secara default, pembelajaran rute dan penerusan terkait dinonaktifkan antara tabel rute router transit dan koneksi VPC.

Prasyarat

Sebelum memanggil operasi ini, pastikan persyaratan berikut terpenuhi:

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

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 klien yang digunakan untuk memastikan idempotensi permintaan.

Anda dapat menghasilkan token ini di sisi klien, tetapi harus memastikan bahwa token tersebut unik di antara permintaan yang berbeda. Token hanya boleh berisi karakter ASCII.

Catatan

Jika Anda tidak menentukan parameter ini, sistem secara otomatis menggunakan ID permintaan sebagai token klien. ID permintaan mungkin berbeda untuk setiap permintaan.

02fb3da4-130e-11e9-8e44-001****

CenId

string

No

ID instans Cloud Enterprise Network (CEN).

cen-j3jzhw1zpau2km****

TransitRouterId

string

No

ID router transit edisi perusahaan.

tr-bp1su1ytdxtataupl****

RegionId

string

No

ID wilayah tempat VPC ditempatkan.

Anda dapat memanggil operasi DescribeChildInstanceRegions untuk menanyakan daftar wilayah terbaru.

cn-hangzhou

TransitRouterAttachmentName

string

No

Nama koneksi VPC.

Nama harus terdiri dari 1 hingga 128 karakter, dan tidak boleh diawali dengan http:// atau https://. Anda juga dapat mengosongkan parameter ini.

testname

TransitRouterAttachmentDescription

string

No

Deskripsi koneksi VPC.

Deskripsi harus terdiri dari 1 hingga 256 karakter, dan tidak boleh diawali dengan http:// atau https://. Anda juga dapat mengosongkan parameter ini.

testname

VpcId

string

Yes

ID VPC.

vpc-bp1kbjcre9vtsebo1****

VpcOwnerId

integer

No

ID Akun Alibaba Cloud pemilik VPC. Nilai default adalah ID Akun Alibaba Cloud saat ini.

Catatan

Jika instance jaringan dan instans CEN dimiliki oleh Akun Alibaba Cloud yang berbeda, parameter ini wajib diisi.

1250123456123456

ChargeType

string

No

Metode penagihan. Nilai default adalah POSTPAY, yang menunjukkan metode penagihan pay-as-you-go.

POSTPAY

DryRun

boolean

No

Menentukan apakah akan melakukan dry run. Nilai yang valid:

  • false (default): melakukan dry run dan mengirim permintaan.

  • true: melakukan dry run. Sistem memeriksa parameter yang diperlukan dan sintaks permintaan. Jika permintaan gagal dalam dry run, pesan kesalahan dikembalikan. Jika permintaan lolos dry run, kode kesalahan DryRunOperation dikembalikan.

false

ZoneMappings

array<object>

Yes

Zona yang mendukung router transit edisi perusahaan.

Anda dapat menentukan maksimal 10 zona.

object

No

Zona yang mendukung router transit edisi perusahaan dan informasi mengenai vSwitch di zona tersebut.

VSwitchId

string

Yes

vSwitch yang ditempatkan di zona yang mendukung router transit edisi perusahaan.

Anda dapat menentukan vSwitch untuk maksimal 10 zona dalam setiap panggilan.

vsw-bp1a214sbus8z3b54****

ZoneId

string

Yes

ID zona yang mendukung router transit edisi perusahaan.

Anda dapat memanggil operasi DescribeZones untuk menanyakan daftar zona terbaru.

Anda dapat menentukan maksimal 10 zona dalam setiap panggilan.

cn-hangzhou-h

AutoPublishRouteEnabled

boolean

No

Menentukan apakah router transit edisi perusahaan diaktifkan untuk secara otomatis mengiklankan rute ke VPC. Nilai yang valid:

  • false: (default)

  • true

true

TransitRouterVPCAttachmentOptions

object

No

Konfigurasi fitur koneksi VPC.

string

No

Fitur koneksi VPC.

ipv6Support: menentukan apakah IPv6 diaktifkan.

  • enable: mengaktifkan IPv6.

  • disable (default): menonaktifkan IPv6.

Catatan

Sebelum mengaktifkan IPv6 untuk koneksi VPC, pastikan IPv6 telah diaktifkan untuk VPC dan vSwitch-nya. Untuk informasi selengkapnya, lihat AllocateVpcIpv6Cidr dan CreateVSwitchCidrReservation.

disable

Tag

array<object>

No

Informasi mengenai tag.

Anda dapat menentukan maksimal 20 tag dalam setiap panggilan.

object

No

Key

string

No

Kunci tag.

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

Anda dapat menentukan maksimal 20 kunci tag.

tagtest

Value

string

No

Nilai tag.

Panjang nilai tag antara 0 hingga 128 karakter, dan tidak boleh diawali dengan aliyun atau acs:. Nilai tag juga tidak boleh mengandung http:// atau https://.

Setiap kunci tag harus memiliki nilai tag yang unik. Anda dapat menentukan maksimal 20 nilai tag dalam setiap panggilan.

tagtest

Elemen respons

Element

Type

Description

Example

object

Tanggapan.

TransitRouterAttachmentId

string

ID koneksi VPC.

tr-attach-ia340z7xis7t5s****

RequestId

string

ID permintaan.

C087A369-82B9-43EF-91F4-4B63A9C6E6B6

Contoh

Respons sukses

JSONformat

{
  "TransitRouterAttachmentId": "tr-attach-ia340z7xis7t5s****",
  "RequestId": "C087A369-82B9-43EF-91F4-4B63A9C6E6B6"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 OperationUnsupported.TransitRouterRegionId The specified TransitRouterRegion does not support the operation.
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.RegionId The Specified Parameter RegionId is illegal The error message returned because the specified region is invalid.
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.ZoneId The specified ZoneId is illegal. The error message returned because the specified zone is invalid.
400 IllegalParam.ChargeType The specified ChargeType is illegal. The error message returned because the specified billing method is invalid.
400 InvalidTransitRouterId.NotFound The specified TransitRouterId is not found. The error message returned because the specified transit router does not exist.
400 IncorrectStatus.VpcResource The resource is not in a valid state for the attachment operation. The error message returned because this operation is not supported when the specified VPC is in an unstable state. Wait until all operations related to the VPC are completed.
400 IncorrectStatus.Vpc The resource is not in a valid state for the attachment operation. The error message returned because the status of the VPC does not support this operation. Try again later.
400 IncorrectStatus.VpcOrVswitch The Vpc Or Vswith is not in a valid state for the attachment operation. The error message returned because the status of the VPC or vSwitch does not support this operation. Try again later.
400 OperationNotSupport.VpcAutoRoutesPublish Auto publish vpc routes is not supported in this region. The error message returned because automatic route advertising for VPCs is not supported in the specified region.
400 InvalidOperation.VpnAssociated The operation is not supported because the VPC is associated with VPN. The error message returned because the specified VPC is associated with a VPN.
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 IllegalParam.ZoneMappings The Specified Parameter ZoneMappings is illegal The error message returned because the specified zone mappings (ZoneMappings) is invalid.
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 InvalidCenId.NotFound CenId is not found. The error message returned because the specified CEN instance does not exist.
400 IllegalParam.VSwitchId VSwitchId is illegal. The error message returned because the specified vSwitch ID is invalid.
400 IncorrectStatus.TransitRouterInstance The status of TransitRouter is incorrect. The error message returned because the transit router is in an invalid state.
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 IllegalParam.ServiceMode ServiceMode is illegal. The error message returned because the specified service mode is invalid.
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 OperationUnsupported.CloudBoxVswNotSupport Cloud Box vsw does not support. The error message returned because the instance cannot be connected to the CloudBox vSwitch.
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 Duplicated.ZoneMapping The parameter ZoneMapping is duplicated. The error message returned because the zone mapping contains duplicate routes.
400 QuotaExceeded.CenQuotaVpcAttachPerTransitRouter The maximum number of VPC attachment per Transit Router is exceeded. The error message returned because the specified number of VPCs to be attache to the transit router exceeds the upper limit.
400 IncorrectStatus.VpcRouteTable The VPC route table is not in a desired state. The error message returned because the VPC route table is in an unstable state. Try again later.
400 InvalidStatus.VpcAttachedFullModeCen The VPC has been attached to another CEN instance whose protection level is FULL. The error message returned because the specified VPC is already attached to a CEN instance whose protection level is FULL. The VPC cannot be attached to other CEN instances.
400 Forbbiden.AttachChildInstanceAcrossBid VPCs that belong to another BID cannot be associated. You need to apply for cross-BID attaching. The error message returned because you cannot associate with VPCs that belong to another BID.
400 InvalidOperation.VpcAutoRoutesPublishInOtherCEN The specified VPC already has its routes synchronized with another CEN instance. The error message returned because this operation is not supported when route synchronization is enabled between the current VPC and another CEN instance.
400 QuotaExceeded.VpcAutoRoutesPublishPerTransitRouter The number of VPCs that have route synchronization enabled has reached the upper limit. The error message returned because the number of VPCs that have route synchronization enabled has reached the upper limit.
400 InsufficientIpAddr.vsw Insufficient available IP addresses in the vSwitch. The error message returned because the number of available IP addresses in the vSwitch is insufficient.
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 IllegalParam.TransitRouterRegionId TransitRouterRegionId is illegal. The error message returned because the specified transit router region ID (TransitRouterRegionId) is invalid.
400 InvalidTransitRouterMode.NeedUpgrade TransitRouter need to upgrade. The error message returned because the specified transit router mode is not supported.
400 IllegalParam.Ipv6Support Ipv6Support is illegal. Valid Values are [enable, disable]. The Ipv6Support value of the request parameter is invalid. The valid value is enable or disable.
400 OperationFailed.VSwitchNotFound The specified vswitch not found. The specified vswitch not found.
400 OperationFailed.VSwitchIpv6CidrNotAllocated The specified vswitch does not have IPv6 address allocated. The specified vswitch does not have IPv6 address allocated.
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 InvalidParameter.ResourceType The specified parameter ResourceType is invalid.
400 ParamExclusive.TransitRouterVPCAttachmentOptionsAndOptions When creating or modifying a VPC attachment, the input parameter TransitRouterVPCAttachmentOptions and Options cannot be used at the same time. When creating or modifying a VPC attachment, the input parameter TransitRouterVPCAttachmentOptions and Options cannot be used at the same time.
400 InvalidParameter.ApplianceModeSupport The specified parameter ApplianceModeSupport is invalid. The parameter ApplianceModeSupport entered is illegal.
400 InvalidParameter.Ipv6Support The specified parameter Ipv6Support is invalid. The parameter Ipv6Support entered is illegal.
400 INVALID_OPERATION_RESOURCE_NOT_SUPPORT_APPLIANCE_MODE Only VPC attachment support appliance mode. Only VPC attachment support appliance mode.
404 InvalidVSwitchId.NotFound The specified VSwitchId is not found. The error message returned because the specified vSwitch ID does not exist.
409 InvalidOperation.CenInstanceStatus The CEN instance is not in a valid state for the operation. The error message returned because the status of the CEN instance does not support this operation.
409 IncorrectStatus.VpcSwitch The resource is not in a valid state for the attachment operation.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.