All Products
Search
Document Center

Resource Orchestration Service:CreateStackInstances

Last Updated:Sep 24, 2026

Creates stack instances for one or more accounts in specified regions.

Operation description

Before you begin

Make sure that you have created a stack group. For more information, see CreateStackGroup.

Common scenarios

Create stacks across accounts

When an enterprise needs to create identical resources across multiple accounts, the administrator account can add multiple execution accounts and deploy to a single region when creating a stack group. This creates multiple stacks in different accounts within the same region, improving deployment efficiency.

Create stacks across regions

When an enterprise needs to create identical resources across multiple regions, the administrator account can add a single execution account and deploy to multiple regions when creating a stack group. This creates multiple stacks in different regions under the same account, improving deployment efficiency.

Create stacks across accounts and regions

When an enterprise needs to create identical resources across multiple accounts and regions, the administrator account can add multiple execution accounts and deploy to multiple regions when creating a stack group. This creates multiple stacks in different regions under different accounts, improving deployment efficiency.

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

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

ros:CreateStackInstances

create

*StackInstance

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the stack group.

You can call DescribeRegions to query the most recent region list.

cn-hangzhou

StackGroupName

string

Yes

The name of the stack group. The name must be unique within a region.

The name can be up to 255 characters in length and must start with a digit or a letter. It can contain digits, letters, hyphens (-), and underscores (_).

MyStackGroup

AccountIds

array

No

The list of execution account IDs for deploying stacks with self-managed permissions. You can add up to 50 execution account IDs.

Note

You must specify one and only one of AccountIds and DeploymentTargets.

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

string

No

The list of execution account IDs for deploying stacks with self-managed permissions. You can add up to 50 execution account IDs.

Note

You must specify one and only one of AccountIds and DeploymentTargets.

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

RegionIds

array

Yes

The list of target regions. You can add up to 20 regions.

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

string

No

The list of target regions. You can add up to 20 regions.

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

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests.

The token can be up to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).

For more information, see How to ensure idempotence.

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

OperationDescription

string

No

The description of the operation to create stacks.

The description must be 1 to 256 characters in length.

Create stack instances in hangzhou and beijing

OperationPreferences

object

No

The operation settings for creating stacks.

The following parameters are included:

  • {"FailureToleranceCount": N}

    The failure tolerance count. The maximum number of accounts in each region for which stack operations can fail before the operation stops in that region. If the operation stops in one region, it does not continue in other regions.

    Valid values of N: 0 to 20.

    If you do not specify FailureToleranceCount, the default value 0 is used.

  • {"FailureTolerancePercentage": N}

    The failure tolerance percentage. The percentage of the total number of accounts in each region for which stack operations can fail before the operation stops in that region.

    Valid values of N: 0 to 100. If the percentage is not an integer, Resource Orchestration Service (ROS) rounds down the value.

    If you do not specify FailureTolerancePercentage, the default value 0 is used.

  • {"MaxConcurrentCount": N}

    The maximum concurrent accounts. The maximum number of accounts in each region to which stacks can be deployed simultaneously.

    Valid values of N: 1 to 20.

    If you do not specify MaxConcurrentCount, the default value 1 is used.

  • {"MaxConcurrentPercentage": N}

    The maximum concurrent account percentage. The percentage of the total number of accounts in each region to which stacks can be deployed simultaneously.

    Valid values: 1 to 100. If the percentage is not an integer, ROS rounds down the value.

    If you do not specify MaxConcurrentPercentage, the default value 1 is used.

  • {"RegionConcurrencyType": N} The region-level concurrency type for deploying stacks. Valid values:

    • SEQUENTIAL (default): Deploys stacks in each specified region sequentially in order. Only one region is deployed at a time.

    • PARALLEL: Deploys stacks in all specified regions in parallel.

Separate multiple parameters with commas (,).

Note
  • You cannot specify both MaxConcurrentCount and MaxConcurrentPercentage.

  • You cannot specify both FailureToleranceCount and FailureTolerancePercentage.

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

TimeoutInMinutes

integer

No

The timeout period for creating stacks.

  • Default value: 60.

  • Unit: minutes.

10

DisableRollback

boolean

No

Specifies whether to disable rollback when stack creation fails.

Valid values:

  • true: disables rollback. No rollback is performed when stack creation fails.

  • false (default): enables rollback. Rollback is performed when stack creation fails.

false

ParameterOverrides

array<object>

No

The list of parameters to override.

object

No

ParameterKey

string

Yes

The name of the parameter to override. If you do not specify a parameter name, ROS uses the template parameter name specified when the stack group was created.

Maximum value of N: 200.

Note
  • 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 override. If you do not specify a parameter value, ROS uses the template parameter value specified when the stack group was created.

Maximum value of N: 200.

Note
  • ParameterOverrides is optional.

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

1

DeploymentTargets

object

No

The deployment targets for deploying stacks with service-managed permissions.

Note

You must specify one and only one of AccountIds and DeploymentTargets.

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

RdFolderIds

array

Yes

The list of resource folder IDs in the resource directory. You can add up to 20 resource folder IDs.

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

Note

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

string

No

The list of resource folder IDs in the resource directory. You can add up to 20 resource folder IDs.

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

Note

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

["fd-4PvlVLOL8v"]

AccountIds

array

No

The list of member account IDs in the resource directory. You can add up to 30 member account IDs.

Note

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

string

No

The list of member account IDs in the resource directory. You can add up to 30 member account IDs.

Note

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

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

DeploymentOptions

array

No

The list of deployment options for deploying stacks with service-managed permissions. You can specify up to one deployment option.

string

No

Valid values:

  • IgnoreExisting: ignores the error if the stack instance to be created already exists.

IgnoreExisting

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

OperationId

string

The operation ID.

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

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.