CreateStackGroup
Creates a stack group from an ROS template to create stacks across multiple Alibaba Cloud accounts and regions.
Operation description
A stack group manages multiple ROS stacks as a unit, enabling you to create stacks across Alibaba Cloud accounts and regions.
Stack groups support two permission models:
-
Self-managed: Both the administrator and execution accounts are Alibaba Cloud accounts.
-
Service-managed: The administrator account is the management account or delegated administrator account of a resource directory. The execution account is a member account of that directory.
This example creates a self-managed stack group named MyStackGroup in the China (Hangzhou) region using template 5ecd1e10-b0e9-4389-a565-e4c15efc****.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ros:CreateStackGroup |
create |
*StackGroup
Template
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the stack group. Call DescribeRegions to query available regions. |
cn-hangzhou |
| StackGroupName |
string |
Yes |
The stack group name. Must be unique within a region. 1 to 255 characters. Can contain letters, digits, hyphens (-), and underscores (_). Must start with a letter or digit. |
MyStackGroup |
| Description |
string |
No |
The stack group description. 1 to 256 characters. |
StackGroup Description |
| TemplateBody |
string |
No |
The template body. 1 to 524,288 bytes. For large templates, pass the body in the HTTP POST request body to avoid URL length limits. Note
Specify exactly one of TemplateBody, TemplateURL, and TemplateId. |
{"ROSTemplateFormatVersion":"2015-09-01"} |
| TemplateURL |
string |
No |
The URL of the template file. Supports HTTP, HTTPS, and OSS URLs. 1 to 524,288 bytes. Examples: oss://ros/template/demo, oss://ros/template/demo?RegionId=cn-hangzhou. If no region ID is specified for the OSS bucket, the RegionId value applies. Note
Specify exactly one of TemplateBody, TemplateURL, and TemplateId. |
oss://ros-template/demo |
| ClientToken |
string |
No |
The client token for idempotency. Must be unique across requests. Can contain letters, digits, underscores (_), and hyphens (-), up to 64 characters. How to ensure idempotence. |
123e4567-e89b-12d3-a456-42665544**** |
| AdministrationRoleName |
string |
No |
The RAM role for the administrator account in a self-managed stack group. ROS assumes this role to perform operations. Default: AliyunROSStackGroupAdministrationRole. 1 to 64 characters. Can contain letters, digits, and hyphens (-). Note
This parameter is required when PermissionModel is set to SELF_MANAGED. |
AliyunROSStackGroupAdministrationRole |
| ExecutionRoleName |
string |
No |
The RAM role for the execution account in a self-managed stack group. The administrator role assumes this role to perform stack operations. Default: AliyunROSStackGroupExecutionRole. 1 to 64 characters. Can contain letters, digits, and hyphens (-). Note
This parameter is required when PermissionModel is set to SELF_MANAGED. |
AliyunROSStackGroupExecutionRole |
| TemplateId |
string |
No |
The template ID. Applies to shared and private templates. Note
Specify exactly one of TemplateBody, TemplateURL, and TemplateId. |
5ecd1e10-b0e9-4389-a565-e4c15efc**** |
| TemplateVersion |
string |
No |
The template version. Defaults to the latest version. Note
TemplateVersion takes effect only if you specify TemplateId. |
v1 |
| Parameters |
array<object> |
No |
The parameters of the stack group. |
|
|
object |
No |
|||
| ParameterKey |
string |
Yes |
The key of parameter N. If not specified, ROS uses the default name and value defined in the template. Maximum value of N: 200. Note
Parameters is optional. If you specify Parameters, you must also specify Parameters.N.ParameterKey. |
Amount |
| ParameterValue |
string |
Yes |
The value of parameter N. Maximum value of N: 200. Note
Parameters is optional. If you specify Parameters, you must also specify Parameters.N.ParameterValue. |
12 |
| ResourceGroupId |
string |
No |
The resource group ID. Defaults to the default resource group. Resource groups. |
rg-acfmxazb4ph6aiy**** |
| PermissionModel |
string |
No |
The permission model of the stack group. Valid values:
Note
To use SERVICE_MANAGED, your account must be the management account or a delegated administrator account of a resource directory with trusted access enabled. Manage a delegated administrator account and Enable trusted access. |
SELF_MANAGED |
| Tags |
array<object> |
No |
The tags of the stack group. |
|
|
object |
No |
The tag of the stack group. |
||
| Key |
string |
Yes |
The tag key of the stack group. Note
Tags is optional. If you want to specify Tags, you must also specify Tags.N.Key. |
usage |
| Value |
string |
No |
The tag value of the stack group. |
test |
| AutoDeployment |
object |
No |
The automatic deployment settings. Note
You must specify this parameter if PermissionModel is set to SERVICE_MANAGED. |
{"Enabled": true, "RetainStacksOnAccountRemoval": true} |
| Enabled |
boolean |
No |
Whether automatic deployment is enabled. Valid values:
|
true |
| RetainStacksOnAccountRemoval |
boolean |
No |
Whether to retain stacks when a member account is removed from the folder. Valid values:
Note
You must specify RetainStacksOnAccountRemoval if Enabled is true. |
true |
| Capabilities |
array |
No |
The options for the stack group. Maximum: one option. |
|
|
string |
No |
The stack group option. Valid value: ExpandModules, which expands modules within the current account. Note
Valid values:
|
ExpandModules |
|
| StackArn |
string |
No |
The stack ARN in the format acs:ros:${RegionId}:${AccountId}:stack/${StackId}. The stack group uses the template and parameters of this stack. Note
|
acs:ros:cn-hangzhou:175458000000****:stack/4a65f506-c3cc-43b6-af06-3f000000**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
14A07460-EBE7-47CA-9757-12CC4761D47A |
| StackGroupId |
string |
The stack group ID. |
2c036e78-9e82-428e-afd6-177f5d04**** |
Examples
Success response
JSON format
{
"RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
"StackGroupId": "2c036e78-9e82-428e-afd6-177f5d04****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.