All Products
Search
Document Center

Resource Orchestration Service:UpdateStackInstances

Last Updated:Dec 19, 2025

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

Operation description

This topic provides an example of how to update stacks for the stack group MyStackGroup, which is in the China (Hangzhou) region and uses self-managed permissions. The stacks are updated for the Alibaba Cloud accounts 151266687691**** and 141261387191**** in the China (Hangzhou) and China (Beijing) regions.

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

update

*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. Call DescribeRegions to get the latest list of Alibaba Cloud regions.

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 letter or a number. It can contain letters, numbers, hyphens (-), and underscores (_).

MyStackGroup

AccountIds

array

No

The IDs of the destination accounts for which you want to deploy stacks with self-managed permissions. You can specify up to 30 account IDs.

Note

This parameter is required when you update stacks with self-managed permissions.

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

string

No

The IDs of the destination accounts for which you want to deploy stacks with self-managed permissions. You can specify up to 30 account IDs.

Note

This parameter is required when you update stacks with self-managed permissions.

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

RegionIds

array

Yes

The list of regions where you want to perform the operation. You can specify up to 20 regions.

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

string

No

The list of regions where you want to perform the operation. You can specify up to 20 regions.

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

ClientToken

string

No

A client token that is used to ensure the idempotence of the request. The client token is generated by the client and must be globally unique.
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 update operation.

The description must be 1 to 256 characters in length.

Update stack instances in hangzhou and beijing

OperationPreferences

object

No

The operation settings for updating the stacks.

This includes the following parameters:

  • {"FailureToleranceCount": N}

    The number of accounts in which the stack operation can fail in a region. If the number of failures in a region exceeds this value, Resource Orchestration Service (ROS) stops the operation in that region. If the operation is stopped in one region, it does not continue in other regions.

    N must be an integer from 0 to 20.

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

  • {"FailureTolerancePercentage": N}

    The percentage of accounts in which the stack operation can fail in a region. If the percentage of failures in a region exceeds this value, ROS stops the operation in that region.

    N must be an integer from 0 to 100. If the percentage is not an integer, ROS rounds it down to the nearest integer.

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

  • {"MaxConcurrentCount": N}

    The maximum number of accounts in which stacks can be deployed at the same time in a region.

    N must be an integer from 1 to 20.

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

  • {"MaxConcurrentPercentage": N}

    The percentage of accounts in which stacks can be deployed at the same time in a region.

    The value must be an integer from 1 to 100. If the percentage is not an integer, ROS rounds it down to the nearest integer.

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

  • {"RegionConcurrencyType": N} The concurrency type for deploying stacks in different regions. Valid values:

    • SEQUENTIAL (Default): Deploys stacks in the specified regions one by one in sequence. At any one time, stacks are deployed in only one region.

    • 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 the update operation.

  • Default value: 60.

  • Unit: minutes.

10

ParameterOverrides

array<object>

No

The list of parameters to overwrite.

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 you specified when you created the stack group.

The value of N can be up to 200.

Note
  • The ParameterOverrides parameter 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 the name and value of a parameter, ROS uses the parameter that you specified when you created the stack group.

The value of N can be up to 200.

Note
  • The ParameterOverrides parameter 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 the stacks that are deployed in service-managed mode.

Note

This parameter is required when you update stacks in service-managed mode.

RdFolderIds

array

No

The IDs of the folders in the resource directory.

string

No

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

You must specify `RdFolderIds` or `AccountIds`.

  • If you specify `RdFolderIds` but not `AccountIds`, stacks are deployed in all member accounts in the specified folders. If you specify the root folder, stacks are deployed in all member accounts in your resource directory.

  • If you specify `AccountIds` but not `RdFolderIds`, stacks are deployed in the specified member accounts.

  • If you specify both parameters, the accounts in `AccountIds` must be in the folders specified by `RdFolderIds`. Stacks are deployed in the specified member accounts.

Note

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 50 member account IDs.

Note

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 50 member account IDs.

Note

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****"]

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.