All Products
Search
Document Center

Resource Orchestration Service:CreateStackInstances

Last Updated:Jun 10, 2026

Membuat Instans tumpukan untuk satu atau beberapa akun di wilayah yang ditentukan.

Deskripsi operasi

Prerequisites

Ensure that a stack group is created. For more information, see CreateStackGroup.

Scenarios

Create stacks across accounts

To create identical resources in multiple accounts, an administrator account can create a stack group, add multiple destination accounts, and deploy resources in a single region. This process creates multiple stacks in different accounts within the same region, improving deployment efficiency.

Create stacks across regions

To create identical resources in multiple regions, an administrator account can create a stack group, add a destination account, and deploy resources in multiple regions. This process creates multiple stacks in different regions within the same account, improving deployment efficiency.

Create stacks across accounts and regions

To create identical resources in multiple accounts across multiple regions, an administrator account can create a stack group, add multiple destination accounts, and deploy resources in multiple regions. This process creates multiple stacks in different accounts across different regions, improving deployment efficiency.

This topic provides an example of creating stacks in the China (Hangzhou) and China (Beijing) regions in the Alibaba Cloud accounts 151266687691**** and 141261387191****. The example uses a stack group named MyStackGroup that is created in the China (Hangzhou) region and uses self-managed permissions.

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

ros:CreateStackInstances

create

*StackInstance

acs:ros:{#regionId}:{#accountId}:stackinstance/{#StackGroupName}/{#StackInstanceAccountId}/{#StackInstanceRegionId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID wilayah Grup tumpukan.

Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah Alibaba Cloud terbaru.

cn-hangzhou

StackGroupName

string

Yes

Nama Grup tumpukan. Nama harus unik dalam suatu wilayah.
Nama dapat memiliki panjang hingga 255 karakter. Nama harus dimulai dengan huruf atau angka dan dapat berisi huruf, angka, tanda hubung (-), dan garis bawah (_).

MyStackGroup

AccountIds

array

No

ID akun tujuan tempat Anda ingin membuat stack menggunakan izin yang dikelola sendiri. Anda dapat menentukan hingga 50 ID akun.

Catatan

Anda hanya dapat menentukan salah satu dari parameter AccountIds dan DeploymentTargets.

["151266687691****","141261387191****"]

string

No

The IDs of the destination accounts where you want to create stacks using self-managed permissions. You can specify up to 50 account IDs.

Catatan

You can specify only one of the AccountIds and DeploymentTargets parameters.

["151266687691****", "141261387191****"]

RegionIds

array

Yes

ID wilayah tujuan. Anda dapat menentukan hingga 20 ID wilayah.

["cn-hangzhou", "cn-beijing"]

string

No

The IDs of the destination regions. You can specify up to 20 region IDs.

["cn-hangzhou","cn-beijing"]

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan. Klien menghasilkan token, yang harus unik secara global.
Token dapat memiliki panjang hingga 64 karakter dan dapat berisi huruf, angka, tanda hubung (-), dan garis bawah (_).
Untuk informasi selengkapnya, lihat Cara memastikan idempotensi.

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

OperationDescription

string

No

Deskripsi operasi untuk membuat stack.

Deskripsi harus memiliki panjang 1 hingga 256 karakter.

Create stack instances in hangzhou and beijing

OperationPreferences

object

No

Preferensi untuk operasi.

Parameter berikut tersedia:

  • {"FailureToleranceCount": N}

    Jumlah akun per wilayah yang operasinya dapat gagal. Jika jumlah operasi yang gagal di suatu wilayah melebihi nilai ini, Resource Orchestration Service (ROS) menghentikan operasi di wilayah tersebut. Jika operasi dihentikan di suatu wilayah, operasi tidak dilakukan di wilayah lain.

    Nilai N dapat berupa bilangan bulat dari 0 hingga 20.

    Jika Anda tidak menentukan parameter ini, nilai default adalah 0.

  • {"FailureTolerancePercentage": N}

    Persentase akun per wilayah yang operasinya dapat gagal, relatif terhadap jumlah total akun. Jika persentase operasi yang gagal di suatu wilayah melebihi nilai ini, ROS menghentikan operasi di wilayah tersebut.

    Nilai N dapat berupa bilangan bulat dari 0 hingga 100. Jika persentasenya bukan bilangan bulat, ROS membulatkan nilai ke bawah.

    Jika Anda tidak menentukan parameter ini, nilai default adalah 0.

  • {"MaxConcurrentCount": N}

    Jumlah maksimum akun di setiap wilayah tempat stack dapat diterapkan secara bersamaan.

    Nilai N dapat berupa bilangan bulat dari 1 hingga 20.

    Jika Anda tidak menentukan parameter ini, nilai default adalah 1.

  • {"MaxConcurrentPercentage": N}

    Persentase akun di setiap wilayah tempat stack dapat diterapkan secara bersamaan, relatif terhadap jumlah total akun.

    Nilai N dapat berupa bilangan bulat dari 1 hingga 100. Jika persentasenya bukan bilangan bulat, ROS membulatkan nilai ke bawah.

    Jika Anda tidak menentukan parameter ini, nilai default adalah 1.

  • {"RegionConcurrencyType": N}
    Tipe konkurensi wilayah penerapan. Nilai valid:

    • SEQUENTIAL (default): Menerapkan stack di wilayah yang ditentukan satu per satu. Stack diterapkan hanya di satu wilayah pada satu waktu.

    • PARALLEL: Menerapkan stack di semua wilayah yang ditentukan secara bersamaan.

Pisahkan beberapa parameter dengan koma (,).

Catatan
  • Anda tidak dapat menentukan MaxConcurrentCount dan MaxConcurrentPercentage secara bersamaan.

  • Anda tidak dapat menentukan FailureToleranceCount dan FailureTolerancePercentage secara bersamaan.

{"FailureToleranceCount": 1, "MaxConcurrentCount": 2}

TimeoutInMinutes

integer

No

Periode batas waktu untuk membuat stack.

  • Nilai default: 60.

  • Unit: menit.

10

DisableRollback

boolean

No

Apakah akan menonaktifkan rollback ketika stack gagal dibuat.

Nilai valid:

  • true: Menonaktifkan rollback.

  • false (default): Mengaktifkan rollback.

false

ParameterOverrides

array<object>

No

Daftar parameter yang menimpa parameter templat.

object

No

ParameterKey

string

Yes

The name of the parameter to overwrite. If you do not specify this parameter, ROS uses the parameter name that was specified when the stack group was created.

You can specify up to 200 parameters.

Catatan
  • ParameterOverrides is optional.

  • If you specify ParameterOverrides, you must specify both ParameterOverrides.N.ParameterKey and ParameterOverrides.N.ParameterValue.

Amount

ParameterValue

string

Yes

The value of the parameter to overwrite. If you do not specify this parameter, ROS uses the parameter value that was specified when the stack group was created.

You can specify up to 200 parameters.

Catatan
  • ParameterOverrides is optional.

  • If you specify ParameterOverrides, you must specify both ParameterOverrides.N.ParameterKey and ParameterOverrides.N.ParameterValue.

1

DeploymentTargets

object

No

Target penerapan untuk menerapkan stack dalam mode izin yang dikelola layanan.

Catatan

Anda hanya dapat menentukan salah satu dari parameter AccountIds dan DeploymentTargets.

{"RdFolderId": "fd-4PvlVLOL8v"}

RdFolderIds

array

Yes

The IDs of the folders in the resource directory. You can specify up to 20 folder IDs.

You can create stacks in all the member accounts in the specified folders. If you select the root folder, stacks are created in all the member accounts in the resource directory.

Catatan

You can view the folder IDs on the Overview page in the Resource Management console. For more information, see View the basic information of a folder.

string

No

The IDs of the folders in the resource directory. You can specify up to 20 folder IDs.

You can create stacks in all the member accounts in the specified folders. If you select the root folder, stacks are created in all the member accounts in the resource directory.

Catatan

You can view the folder IDs on the Overview page in the Resource Management console. For more information, see View the basic information of a folder.

["fd-4PvlVLOL8v"]

AccountIds

array

No

The IDs of the member accounts in the resource directory. You can specify up to 30 member account IDs.

Catatan

You can view the member account IDs on the Overview page in the Resource Management console. For more information, see View the details of a member.

string

No

The IDs of the member accounts in the resource directory. You can specify up to 30 member account IDs.

Catatan

You can view the member account IDs on the Overview page in the Resource Management console. For more information, see View the details of a member.

["151266687691****","141261387191****"]

DeploymentOptions

array

No

Opsi penerapan untuk menerapkan stack dalam mode izin yang dikelola layanan. Anda dapat menentukan hingga satu opsi penerapan.

string

No

Valid value:

  • IgnoreExisting: Ignores the error that is reported if the stack instance that you want to create already exists.

Untuk informasi selengkapnya tentang parameter permintaan umum, lihat Parameter umum.

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

14A07460-EBE7-47CA-9757-12CC4761D47A

OperationId

string

The ID of the operation.

6da106ca-1784-4a6f-a7e1-e723863d****

Contoh

Respons sukses

JSONformat

{
  "RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "OperationId": "6da106ca-1784-4a6f-a7e1-e723863d****"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.