Updates a stack group.

In this example, the template content {"ROSTemplateFormatVersion": "2015-09-01"} is specified to update a stack group named MyStackGroup. The stack group is granted self-managed permissions and created in the China (Hangzhou) region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateStackGroup

The operation that you want to perform. Set the value to UpdateStackGroup.

RegionId String Yes cn-hangzhou

The region ID of the stack group. You can call the DescribeRegions operation to query the most recent region list.

StackGroupName String Yes MyStackGroup

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 can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

Description String No My Stack Group

The description of the stack group.

The description must be 1 to 256 characters in length.

AccountIds Array of String No ["151266687691****","141261387191****"]

The IDs of the accounts within which you use the self-managed permission model to deploy stacks. You can specify a maximum of 20 account IDs.

RegionIds Array of String No ["cn-hangzhou","cn-beijing"]

The region IDs of stack instances. You can specify a maximum of 20 region IDs.

TemplateBody String No {"ROSTemplateFormatVersion": "2015-09-01"}

The template body. The template body must be 1 to 524,288 bytes in length. If the required length exceeds the maximum value, we recommend that you specify parameters in the HTTP POST request body to prevent request failures due to excessive length of URLs.

Note You must specify one of the TemplateBody, TemplateURL, and TemplateId parameters.
TemplateURL String No oss://ros-template/demo

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

Note You must specify one of the TemplateBody, TemplateURL, and TemplateId parameters.
ClientToken String No 123e4567-e89b-12d3-a456-42665544****

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it 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.

OperationDescription String No Update stack instances in hangzhou

The description of the operation to update the stack group.

OperationPreferences Map No {"FailureToleranceCount": 1,"MaxConcurrentCount": 2}

The preferences of the operation to update the stack group.

Available parameters in the operation preferences:

  • {"FailureToleranceCount": N}

    The maximum number of stack operation failures that can occur within the accounts in each region. When the value is exceeded, Resource Orchestration Service (ROS) stops the operation in the region. If ROS stops the operation in one region, ROS stops the operation in other regions.

    Valid values of N: 0 to 20.

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

  • {"FailureTolerancePercentage": N}

    The percentage of the total number of accounts within which stack operation failures can occur to the total number of accounts in each region. When the value is exceeded, ROS stops the operation in the region.

    Valid values of N: 0 to 100. If the numeric value in the percentage is not an integer, ROS rounds the number down to the nearest integer.

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

  • {"MaxConcurrentCount": N}

    The maximum number of accounts within which operations are concurrently performed on stacks in each region.

    Valid values of N: 1 to 20.

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

  • {"MaxConcurrentPercentage": N}

    The percentage of the total number of accounts within which operations are concurrently performed on stacks to the total number of accounts in each region.

    Valid values of N: 1 to 100. If the numeric value in the percentage is not an integer, ROS rounds the number down to the nearest integer.

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

Separate multiple parameters with commas (,).

Note
  • You can specify one of the MaxConcurrentCount and MaxConcurrentPercentage parameters.
  • You can specify one of the FailureToleranceCount and FailureTolerancePercentage parameters.
AdministrationRoleName String No AliyunROSStackGroupAdministrationRole

The name of the RAM role that you specify for the administrator account in ROS when you create the self-managed stack group. If you do not specify this parameter, the default value AliyunROSStackGroupAdministrationRole is used. You can use the administrator role in ROS to assume the execution role AliyunROSStackGroupExecutionRole to perform operations on the stacks that correspond to stack instances in the stack group.

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

ExecutionRoleName String No AliyunROSStackGroupExecutionRole

The name of the RAM role that you specify for the execution account when you create the self-managed stack group. You can use the administrator role AliyunROSStackGroupAdministrationRole to assume the execution role. If you do not specify this parameter, the default value AliyunROSStackGroupExecutionRole is used. You can use this role in ROS to perform operations on the stacks that correspond to stack instances in the stack group.

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

TemplateId String No 5ecd1e10-b0e9-4389-a565-e4c15efc****

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

Note You must specify one of the TemplateBody, TemplateURL, and TemplateId parameters.
TemplateVersion String No v1

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

Note This parameter takes effect only when the TemplateId parameter is specified.
PermissionModel String No SELF_MANAGED

The permission model.

Default value: SELF_MANAGED. Valid values:

  • SELF_MANAGED: the self-managed permission model. If you create a self-managed stack group, you must create RAM roles within the administrator and execution accounts to establish a trust relationship between the accounts. Then, you can deploy stacks within the execution account.
  • SERVICE_MANAGED: the service-managed permission model. If you create a service-managed stack group, ROS creates service-linked roles within the administrator and execution accounts, and the administrator account uses its role to deploy stacks within the execution account.
Note
  • If stack instances are created in the stack group, you cannot switch the permission model of the stack group.
  • When you use the service-managed permission model to deploy stacks, your account must be a management account or delegated administrator account in the resource directory and the trusted access feature is enabled for the account.
AutoDeployment Object No

The information about automatic deployment settings.

Note You must specify this parameter only when you set the PermissionModel parameter to SERVICE_MANAGED.
Enabled Boolean Yes true

Specifies whether to enable automatic deployment.

Valid values:

  • true: enables automatic deployment. If you add a member account to the folder to which the stack group belongs after you enable automatic deployment, the stack group deploys its stack instances within the account. If you delete the account from the folder, the stack instances are deleted from the stack group within the account.
  • false: disables automatic deployment. After you disable automatic deployment, the stack instances remain unchanged when you change the member account in the folder.
RetainStacksOnAccountRemoval Boolean No true

Specifies whether to retain stacks in a member account when you delete the member account from the folder.

Valid values:

  • true: retains the stacks.
  • false: deletes the stacks.
Note You must specify this parameter when you set the Enabled parameter to true.
DeploymentTargets Object No

The folders in which you use the service-managed permission model to update stacks.

RdFolderIds Array of String No ["fd-4PvlVLOL8v"]

The folder IDs of the resource directory. You can specify a maximum of five folder IDs.

You must specify at least one of the RdFolderIds and AccountIds parameters. The parameters are subject to the following items:

  • If you specify only the RdFolderIds parameter, stacks are deployed within all the member accounts in the specified folders. If you deploy the stacks in the Root folder, the stacks are deployed within all the member accounts in the resource directory.
  • If you specify only the AccountIds parameter, stacks are deployed within the specified member accounts.
  • If you specify both parameters, the accounts specified by AccountIds must be contained in the folders specified by RdFolderIds.
Note To view the folder IDs, go to the overview page in the Resource Management console. For more information, see View the basic information about a folder.
AccountIds Array of String No ["151266687691****","141261387191****"]

The IDs of the member accounts in the resource directory. You can specify a maximum of 20 member account IDs.

Note To view the member account IDs, go to the overview page in the Resource Management console. For more information, see View the detailed information about a member.
Parameters.N.ParameterKey String Yes Amount

The key of parameter N. If you do not specify the key and value of the parameter, ROS uses the default key and value in the template.

Maximum value of N: 200.

Note Parameters in Parameters.N.ParameterKey is optional. You must specify Parameters.N.ParameterKey if you specify Parameters.
Parameters.N.ParameterValue String Yes 1

The value of parameter N.

Maximum value of N: 200.

Note Parameters in Parameters.N.ParameterValue is optional. You must specify Parameters.N.ParameterValue if you specify Parameters.

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

Response parameters

Parameter Type Example Description
RequestId String 14A07460-EBE7-47CA-9757-12CC4761D47A

The ID of the request.

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

The ID of the operation.

Examples

Sample requests

http(s)://ros.aliyuncs.com/?Action=UpdateStackGroup
&TemplateBody={"ROSTemplateFormatVersion": "2015-09-01"}
&RegionId=cn-hangzhou
&StackGroupName=MyStackGroup
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateStackGroupResponse>
    <RequestId>14A07460-EBE7-47CA-9757-12CC4761D47A</RequestId>
    <OperationId>6da106ca-1784-4a6f-a7e1-e723863d****</OperationId>
</UpdateStackGroupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For a list of error codes, visit the API Error Center.

Error code

Error message

HTTP status code

Description

CircularDependency

Circular Dependency Found: {reason}.

400

The error message returned because the template contains circular dependencies. reason indicates the specific reason.

InvalidSchema

{reason}.

400

The error message returned because the template format is invalid. reason indicates the specific reason.

InvalidTemplateAttribute

The Referenced Attribute ({resource} {name}) is incorrect.

400

The error message returned because the resource attribute referenced in the template is invalid. resource indicates the resource name. name indicates the attribute name.

InvalidTemplatePropertyType

The specified value type of ({resource} {section}) is incorrect.

400

The error message returned because the type of the specified resource section that is defined in the template is invalid. resource indicates the resource name. section indicates the section name.

InvalidTemplateReference

The specified reference "{name}" (in {referencer}) is incorrect.

400

The error message returned because the template contains an invalid reference. name indicates the reference name. referencer indicates the referencer name.

InvalidTemplateSection

The template section is invalid: {section}.

400

The error message returned because the template contains an invalid section. section indicates the section name.

InvalidTemplateVersion

The template version is invalid: {reason}.

400

The error message returned because the template version is invalid. reason indicates the specific reason.

UnknownUserParameter

The Parameter ({name}) was not defined in template.

400

The error message returned because the specified parameter is not defined in the template. name indicates the parameter name.

UserParameterMissing

The Parameter {name} was not provided.

400

The error message returned because no value is set for the specified parameter defined in the template. name indicates the parameter name.

StackGroupOperationInProgress

Another Operation on StackGroup ({name})s is in progress.

409

The error message returned because an operation is being performed on the stack group. name indicates the name of the stack group.

TemplateNotFound

The Tempalte ({ ID }) could not be found.

404

The error message returned because the specified template does not exist. ID indicates the template ID.

TemplateNotFound

The Template { ID } with version { version } could not be found.

404

The error message returned because the specified template or template version does not exist. ID indicates the template ID. version indicates the template version.