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
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
ros:UpdateStackGroup | update | *StackGroup
Template
| 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. | 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. | 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:
Separate multiple parameters with commas (,). Note
| {"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:
Note
| 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 |
RetainStacksOnAccountRemoval | boolean | No | Specifies whether to retain the stacks in the member accounts that are removed from the folder. Valid values:
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:
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
| 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:
|
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.