UpdateStackGroup

Updated at:

Updates an existing stack group.

Operation description

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

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 region ID of the stack group. You can call the DescribeRegions operation 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

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 list of execution account IDs used to deploy stacks in the self-managed permissions mode. You can add up to 50 execution account IDs.

["12****"]

string

No

The list of execution account IDs used to deploy stacks in the self-managed permissions mode. You can add up to 50 execution account IDs.

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

RegionIds

array

No

The list of target regions where stacks are deployed. You can add up to 20 regions.

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

string

No

The list of target regions where stacks are deployed. You can add up to 20 regions.

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

TemplateBody

string

No

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

Note

You must specify only one of the following parameters: TemplateBody, TemplateURL, and TemplateId.

{"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 Object Storage Service (OSS) bucket. The template must be 1 to 524,288 bytes in length. Example of an OSS bucket URL: oss://ros/template/demo or oss://ros/template/demo?RegionId=cn-hangzhou. If the region of the OSS bucket is not specified, the region of the OSS bucket is the same as the value of the RegionId parameter.

Note

You must specify only one of the following parameters: TemplateBody, TemplateURL, and TemplateId.

oss://ros-template/demo

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 Ensure idempotence.

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

OperationDescription

string

No

The description of the stack group update operation.

Update stack instances in hangzhou

OperationPreferences

object

No

The operation settings for updating the stack group.

This parameter includes the following fields:

  • {"FailureToleranceCount": N}

    The number maximum concurrent accounts in which stack failures are tolerated in each region. If the number of failed stacks exceeds this value, the operation in the region stops. If the operation in a region stops, the operation does not continue in other regions.

    Valid values of N: 0 to 20.

    Default value: 0.

  • {"FailureTolerancePercentage": N}

    The percentage maximum concurrent accounts in which stack failures are tolerated in each region. If the percentage of failed stacks exceeds this value, the operation in the region stops.

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

    Default value: 0.

  • {"MaxConcurrentCount": N}

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

    Valid values of N: 1 to 20.

    Default value: 1.

  • {"MaxConcurrentPercentage": N}

    The maximum percentage maximum concurrent accounts in which stacks can be deployed at the same time in each region.

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

    Default value: 1.

  • {"RegionConcurrencyType": N}

    The region-level concurrency type for deploying stack instances. Valid values:

    • SEQUENTIAL (default): deploys stack instances in the specified regions one by one. Only one region is deployed at a time.

    • PARALLEL: deploys stack instances 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}

AdministrationRoleName

string

No

The name of the Resource Access Management (RAM) administrator role that is assumed by ROS when you create a stack group with self-managed permissions. If you do not specify this parameter, AliyunROSStackGroupAdministrationRole is used by default. ROS assumes this role to further assume the execution role (AliyunROSStackGroupExecutionRole) and manage the stacks that correspond to the stack instances in the stack group.

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) when you create a stack group with self-managed permissions. If you do not specify this parameter, AliyunROSStackGroupExecutionRole is used by default. ROS assumes this role to manage the stacks that correspond to the stack instances 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. Shared templates and private templates are supported.

Note

You must specify only one of the following parameters: TemplateBody, TemplateURL, and TemplateId.

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 by default.

Note

TemplateVersion takes effect only when TemplateId is specified.

v1

Parameters

array<object>

No

The list of parameters for the stack group.

object

No

ParameterKey

string

Yes

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

Maximum value of N: 200.

Note

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

Amount

ParameterValue

string

Yes

The value of the parameter.

Maximum value of N: 200.

Note

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

1

PermissionModel

string

No

The authorization pattern.

Valid values:

  • SELF_MANAGED (default): the self-managed permissions pattern. If you use this pattern, you must manually create RAM roles in the administrator account and the execution accounts to establish a trust relationship between the two, and then perform stack deployment in the execution accounts.

  • SERVICE_MANAGED: the service-managed permissions pattern. If you use this pattern, ROS performs automatic creation of service-linked (associate) roles for the administrator account and the execution accounts. The administrator account performs stack deployment in the execution accounts by using the service-linked roles.

Note
  • If the stack group already contains stack instances, you cannot change the authorization pattern.

  • When you use the service-managed permissions pattern for stack deployment, the current account must be the management account or a delegated administrator account of a resource directory (folder), and trusted access must be enabled. For more information, see Settings for delegated administrator accounts and Enable trusted access.

SELF_MANAGED

AutoDeployment

object

No

The auto-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 auto-deployment.

Valid values:

  • true: enables auto-deployment. After auto-deployment is enabled, if a member account is added to the target folder, the stack group automatically deploys a stack instance to the account. If a member account is removed from the target folder, the stack group automatically deletes the stack instance in the account.

  • false: disables auto-deployment. After auto-deployment is disabled, stack instances do not change when member accounts in the target folder change.

true

RetainStacksOnAccountRemoval

boolean

No

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

Valid values:

  • true: retains the stacks.

  • false: deletes the stacks.

Note

RetainStacksOnAccountRemoval is required when Enabled is set to true.

true

DeploymentTargets

object

No

The deployment targets for updating stacks in the service-managed permissions mode.

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

RdFolderIds

array

No

The list of folder IDs in the resource directory.

string

No

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

You must specify at least one of the RdFolderIds and AccountIds parameters based on the following rules:

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

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

  • If you specify both parameters, the accounts specified by AccountIds must belong to the folders specified by RdFolderIds, and stacks are deployed in the specified member accounts.

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 list of IDs of member accounts in the resource directory (folder). You can add up to 30 IDs of member accounts.

Note

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

string

No

The list of IDs of member accounts in the resource directory (folder). You can add up to 30 IDs of member accounts.

Note

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

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

Capabilities

array

No

The list of options for the stack group. Maximum length: 1.

string

No

The options for the stack group. Valid value: ExpandModules, which expands modules in the current account.

Note
  • This option takes effect only when modules are used in the template.

  • By default, modules are not expanded in the current account, and the relevant modules must exist in all target deployment accounts. If modules are expanded in the current account, the relevant modules must exist in the current account.

ExpandModules

DeploymentOptions

array

No

The list of deployment options for updating the stack group in the service-managed permissions mode. You can specify up to 1 deployment option.

string

No

Valid values:

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

  • Configure: modifies the target deployment resource directory without updating the existing instances.

Deploy

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.