All Products
Search
Document Center

Resource Orchestration Service:UpdateStackGroup

Last Updated:Dec 19, 2025

Updates an existing stack group.

Operation description

This topic provides an example of how to update the template of the stack group MyStackGroup to {"ROSTemplateFormatVersion": "2015-09-01"}. The stack group is in the China (Hangzhou) region and uses self-managed permissions.

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

update

*StackGroup

acs:ros:{#regionId}:{#accountId}:stackgroup/{#StackGroupName}

Template

acs:ros:{#regionId}:{#accountId}:template/{#TemplateId}

None

None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the stack group is located. You can call the DescribeRegions operation to query 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 digit or a letter. The name can contain digits, letters, hyphens (-), and underscores (_).

MyStackGroup

Description

string

No

The description of the stack group.

The description must be 1 to 256 characters in length.

My Stack Group

AccountIds

array

No

The IDs of the destination accounts in which to deploy stacks in self-managed permission mode. You can specify a maximum of 50 destination account IDs.

["12****"]

string

No

The IDs of the destination accounts in which to deploy stacks in self-managed permission mode. You can specify a maximum of 50 destination account IDs.

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

RegionIds

array

No

The IDs of the regions where you want to deploy the stacks. You can specify a maximum of 20 region IDs.

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

string

No

The IDs of the regions where you want to deploy the stacks. You can specify a maximum of 20 region IDs.

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

TemplateBody

string

No

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body is large, pass the parameter in the request body using the HTTP POST and Body Param method to prevent request failures caused by an excessively long URL.

Note

You can specify only one of the `TemplateBody`, `TemplateURL`, and `TemplateId` parameters.

{"ROSTemplateFormatVersion": "2015-09-01"}

TemplateURL

string

No

The URL of the file that contains the template body. The URL must point to a template that is located on an HTTP or HTTPS web server or in an Alibaba Cloud Object Storage Service (OSS) bucket. The template body must be 1 to 524,288 bytes in length. For example, the URL of an OSS bucket can be oss://ros/template/demo or oss://ros/template/demo?RegionId=cn-hangzhou. If you do not specify the region of the OSS bucket, the value of the `RegionId` parameter is used.

Note

You can specify only one of the `TemplateBody`, `TemplateURL`, and `TemplateId` parameters.

oss://ros-template/demo

ClientToken

string

No

A 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 update the stack group.

Update stack instances in hangzhou

OperationPreferences

object

No

The preferences for the stack group operation.

The following parameters are included:

  • FailureToleranceCount

    The number of accounts in each region where stack operation failures are allowed. If the number of failed operations in a region exceeds this value, Resource Orchestration Service (ROS) stops the operations in that region. If the operation is stopped in one region, the operation is not initiated in other regions.

    The value must be an integer from 0 to 20.

    If you do not specify this parameter, 0 is used as the default value.

  • FailureTolerancePercentage

    The percentage of accounts in each region where stack operation failures are allowed. If the percentage of failed operations in a region exceeds this value, ROS stops the operations in that region.

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

    If you do not specify this parameter, 0 is used as the default value.

  • MaxConcurrentCount

    The maximum number of accounts in each region where stacks are deployed at the same time.

    The value must be an integer from 1 to 20.

    If you do not specify this parameter, 1 is used as the default value.

  • MaxConcurrentPercentage

    The maximum percentage of accounts in each region where stacks are deployed at the same time.

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

    If you do not specify this parameter, 1 is used as the default value.

  • RegionConcurrencyType The concurrency type of deployment regions. Valid values:

    • SEQUENTIAL (default): Deploys stacks in the specified regions sequentially. At any given time, stacks are deployed in only one region.

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

Separate multiple parameters with commas (,).

Note
  • You can specify only one of `MaxConcurrentCount` and `MaxConcurrentPercentage`.

  • You can specify only one of `FailureToleranceCount` and `FailureTolerancePercentage`.

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

AdministrationRoleName

string

No

The name of the RAM administrator role that is assumed by ROS. This parameter is required when you create a stack group that has self-managed permissions. If you do not specify a value, `AliyunROSStackGroupAdministrationRole` is used as the default value. ROS assumes this role to perform operations on the stacks in the stack group. ROS uses the credentials of this role to assume the execution role (`AliyunROSStackGroupExecutionRole`).

The name must be 1 to 64 characters in length and can contain letters, digits, and hyphens (-).

AliyunROSStackGroupAdministrationRole

ExecutionRoleName

string

No

The name of the RAM execution role that is assumed by the administrator role (`AliyunROSStackGroupAdministrationRole`). This parameter is required when you create a stack group that has self-managed permissions. If you do not specify a value, `AliyunROSStackGroupExecutionRole` is used as the default value. ROS assumes this role to perform operations on the stacks in the stack group.

The name must be 1 to 64 characters in length and can contain letters, digits, and hyphens (-).

AliyunROSStackGroupExecutionRole

TemplateId

string

No

The ID of the template. This parameter applies to shared templates and private templates.

Note

You can specify only one of the `TemplateBody`, `TemplateURL`, and `TemplateId` parameters.

5ecd1e10-b0e9-4389-a565-e4c15efc****

TemplateVersion

string

No

The version of the template. If you do not specify this parameter, the latest version is used.

Note

`TemplateVersion` takes effect only when `TemplateId` is specified.

v1

Parameters

array<object>

No

The parameters of the stack group.

object

No

ParameterKey

string

Yes

The key of the parameter. If you do not specify the key and value of a parameter, ROS uses the default name and value that are specified in the template.

You can specify a maximum of 200 parameters.

Note

The `Parameters` parameter is optional. If you specify `Parameters`, you must specify `Parameters.N.ParameterKey`.

Amount

ParameterValue

string

Yes

The value of the parameter.

You can specify a maximum of 200 parameters.

Note

The `Parameters` parameter is optional. If you specify `Parameters`, you must specify `Parameters.N.ParameterValue`.

1

PermissionModel

string

No

The permission model.

Valid values:

  • SELF_MANAGED (default): Self-managed permissions. If you use this permission model, you must create RAM roles in the administrator and member accounts so that the accounts can be associated with each other. Then, you can deploy stacks in the member accounts.

  • SERVICE_MANAGED: Service-managed permissions. If you use this permission model, ROS creates service-linked roles for the administrator and member accounts. The administrator account uses the service-linked roles to deploy stacks in the member accounts.

Note
  • If stack instances exist in the stack group, you cannot change the permission model.

  • If you use the service-managed permission model to deploy stacks, the current account must be the management account or a delegated administrator account of your resource directory, and trusted access must be enabled for the account. For more information, see Set a delegated administrator account and Enable trusted access.

SELF_MANAGED

AutoDeployment

object

No

The automatic deployment settings.

Note

This parameter is required only when `PermissionModel` is set to `SERVICE_MANAGED`.

{"Enabled": true, "RetainStacksOnAccountRemoval": true}

Enabled

boolean

Yes

Specifies whether to enable automatic deployment.

Valid values:

  • true: Enables automatic deployment. If you enable automatic deployment, ROS automatically deploys stacks to the new member accounts that are added to the folder. If a member account is removed from the folder, ROS automatically deletes the stacks from the account.

  • false: Disables automatic deployment. If you disable automatic deployment, the stacks remain unchanged when the member accounts in the folder change.

true

RetainStacksOnAccountRemoval

boolean

No

Specifies whether to retain the stacks in the member accounts that are removed from the folder.

Valid values:

  • true: Retains the stacks.

  • false: Deletes the stacks.

Note

This parameter is required only when `Enabled` is set to true.

true

DeploymentTargets

object

No

The deployment targets to which you want to deploy stacks in service-managed permission mode.

{"RdFolderIds": ["fd-4PvlVLOL8v"]}

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 a maximum of 20 folder IDs.

You must specify at least one of the `RdFolderIds` and `AccountIds` parameters. The following section describes the parameters:

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

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

  • If you specify both `RdFolderIds` and `AccountIds`, stacks are deployed in the specified member accounts that are in the specified folders.

Note

You can view the folder IDs on the Overview page of 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 a maximum of 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 the details of a member.

string

No

The IDs of the member accounts in the resource directory. You can specify a maximum of 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 the details of a member.

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

Capabilities

array

No

The options for the stack group. You can specify up to one option.

string

No

The option for the stack group. Valid value: `ExpandModules`. This option expands the modules in the current account.

Note
  • This parameter takes effect only if the template contains modules.

  • By default, the modules are not expanded in the current account. The modules must exist in all the deployment destination accounts. If you expand the modules in the current account, the modules must exist in the current account.

ExpandModules

DeploymentOptions

array

No

The deployment options for a stack group with service-managed permissions. You can specify up to one deployment option.

string

No

Valid values:

  • Deploy: Updates the existing instances in the accounts of the specified resource directory.

  • Configure: Modifies the deployment destination resource directory but does not update the existing instances.

For more information about common parameters, see Common parameters.

Response elements

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

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

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.