Creates stack instances for one or more accounts in the specified regions.
Operation description
Prerequisites
Ensure that a stack group is created. For more information, see CreateStackGroup.
Scenarios
Create stacks across accounts
To create identical resources in multiple accounts, an administrator account can create a stack group, add multiple destination accounts, and deploy resources in a single region. This process creates multiple stacks in different accounts within the same region, improving deployment efficiency.
Create stacks across regions
To create identical resources in multiple regions, an administrator account can create a stack group, add a destination account, and deploy resources in multiple regions. This process creates multiple stacks in different regions within the same account, improving deployment efficiency.
Create stacks across accounts and regions
To create identical resources in multiple accounts across multiple regions, an administrator account can create a stack group, add multiple destination accounts, and deploy resources in multiple regions. This process creates multiple stacks in different accounts across different regions, improving deployment efficiency.
This topic provides an example of creating stacks in the China (Hangzhou) and China (Beijing) regions in the Alibaba Cloud accounts 151266687691**** and 141261387191****. The example uses a stack group named MyStackGroup that is created 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:CreateStackInstances | create | *StackInstance
| 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 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 |
| AccountIds | array | No | The IDs of the destination accounts where you want to create stacks using self-managed permissions. You can specify up to 50 account IDs. Note You can specify only one of the | ["151266687691****","141261387191****"] |
string | No | The IDs of the destination accounts where you want to create stacks using self-managed permissions. You can specify up to 50 account IDs. Note You can specify only one of the | ["151266687691****", "141261387191****"] | |
| RegionIds | array | Yes | The IDs of the destination regions. You can specify up to 20 region IDs. | ["cn-hangzhou", "cn-beijing"] |
string | No | The IDs of the destination regions. You can specify up to 20 region IDs. | ["cn-hangzhou","cn-beijing"] | |
ClientToken | string | No | A client token that is used to ensure the idempotence of the request. The client generates the token, which must be globally unique. | 123e4567-e89b-12d3-a456-42665544**** |
OperationDescription | string | No | The description of the operation to create the stacks. The description must be 1 to 256 characters in length. | Create stack instances in hangzhou and beijing |
OperationPreferences | object | No | The preferences for the operation. The following parameters are available:
Separate multiple parameters with commas (,). Note
| {"FailureToleranceCount": 1, "MaxConcurrentCount": 2} |
TimeoutInMinutes | integer | No | The timeout period for creating the stacks.
| 10 |
DisableRollback | boolean | No | Indicates whether to disable rollback when a stack fails to be created. Valid values:
| false |
| ParameterOverrides | array<object> | No | A list of parameters that overwrite the template parameters. | |
object | No | |||
ParameterKey | string | Yes | The name of the parameter to overwrite. If you do not specify this parameter, ROS uses the parameter name that was specified when the stack group was created. You can specify up to 200 parameters. Note
| Amount |
ParameterValue | string | Yes | The value of the parameter to overwrite. If you do not specify this parameter, ROS uses the parameter value that was specified when the stack group was created. You can specify up to 200 parameters. Note
| 1 |
| DeploymentTargets | object | No | The deployment targets for deploying stacks in service-managed permission mode. Note You can specify only one of the | {"RdFolderId": "fd-4PvlVLOL8v"} |
| RdFolderIds | array | Yes | The IDs of the folders in the resource directory. You can specify up to 20 folder IDs. You can create stacks in all the member accounts in the specified folders. If you select the root folder, stacks are created in all the member accounts in the resource directory. Note You can view the folder IDs on the Overview page in the Resource Management console. For more information, see View the basic information of a folder. | |
string | No | The IDs of the folders in the resource directory. You can specify up to 20 folder IDs. You can create stacks in all the member accounts in the specified folders. If you select the root folder, stacks are created in all the member accounts in the resource directory. Note You can view the folder IDs on the Overview page in 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 up to 30 member account IDs. Note You can view the member account IDs on the Overview page in 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 up to 30 member account IDs. Note You can view the member account IDs on the Overview page in the Resource Management console. For more information, see View the details of a member. | ["151266687691****","141261387191****"] | |
| DeploymentOptions | array | No | The deployment options for deploying stacks in service-managed permission mode. You can specify up to one deployment option. | |
string | No | Valid value:
|
For more information about common request 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**** |
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.