If you want to deploy stacks within multiple accounts across regions, you can create a stack group to create stack instances within specified accounts in specified regions. This way, stacks that correspond to the stack instances are automatically deployed.

Background information

Before you create a stack group, you must prepare the following accounts:
  • Administrator account (Account A): the account within which you create a stack group
  • Execution account (Account B): the account within which the stacks are deployed
Note The administrator account and the execution account can be the same Alibaba Cloud account. For more information about administrator and execution accounts, see Terms.

This topic describes how to create a stack group and deploy stacks that correspond to the stack group. In this example, the stack group is created within the administrator account. The stacks are deployed within the execution account in the China (Hangzhou) and China (Beijing) regions.

Procedure

  1. Log on to the Resource Orchestration Service (ROS) console with the administrator account.
  2. In the left-side navigation pane, click Stack Groups.
  3. In the upper-left corner, select the region where you want to create the stack group from the region drop-down list.
  4. On the Stack Groups page, click Create Stack Group.
  5. In the Select Template step, select Select an Existing Template or Use a Sample Template, and click Next.
  6. In the Configure Template Parameters step, configure Stack Group Name, Stack Group Description, and other parameters, and then click Next.
    Note The parameters that you must configure vary based on the template. Follow on-screen instructions to configure the parameters.
  7. In the Configure Stack Group step, select Self-managed Permissions, select AliyunROSStackGroupAdministrationRole from the Admin Role drop-down list and AliyunROSStackGroupExecutionRole from the Execution Role drop-down list, and then click Next.
    Note The administrator role and the execution role are the RAM roles that you create for the administrator and execution accounts when you grant self-managed permissions to the stack group. For more information, see Step 1: Grant self-managed permissions.
  8. In the Set Deployment Options step, configure the following parameters and click Next.
    Parameter Description
    Accounts The account within which the stacks are deployed.

    Configure the Deployment Locations and Accounts parameters based on your business requirements.

    • Deploy Stacks Within Accounts: If you use an Alibaba Cloud account to create a stack group, you can select Deploy Stacks Within Accounts and enter other Alibaba Cloud account IDs in the Accounts field to deploy stacks. Then, the stacks are automatically deployed within the Alibaba Cloud accounts. For example, if you enter the ID of an execution account in the Accounts field when you deploy stacks, the stacks are automatically deployed within the execution account.
      Note If you enter the IDs of multiple accounts, separate the IDs with commas (,). You can also enter the ID of the administrator account in the Accounts field to deploy stacks within the administrator account.
    • Deploy Stacks Within Resource Directories: If you enable a resource directory and use the management account in the resource directory to create a stack group, you can deploy stacks in folders of the resource directory. Then, the stacks are automatically deployed in all member accounts in the folders of the resource directory.
    Regions The regions where you want to deploy stacks. Examples: the China (Hangzhou) and China (Beijing) regions.
    Resource Group The resource group that you use to manage stack groups.

    Select the resource group to which you want to add the stack group. If you do not specify this parameter, the stack group is added to the default resource group.

    For more information about how to create a resource group, see Create a resource group.

    Maximum Number of Concurrent Accounts The maximum number of accounts within which multiple stacks are deployed at a time in each region.

    For more information about how to specify Maximum Number of Concurrent Accounts, see Stack group deployment options.

    Fault Tolerance The maximum number of accounts within which stack operation failures can occur in each region. When the value is exceeded, ROS stops the operation in the region. If ROS stops the operation in one region, ROS stops the operation in other regions.

    For more information about how to specify Fault Tolerance, see Stack group deployment options.

    Note If you do not specify Accounts and Regions, you can create only a stack group in ROS. If you want to deploy stacks within specified accounts in specified regions, you must create stack instances. For more information, see Step 3: (Optional) Create stack instances.
  9. In the Check and Confirm step, check whether the information about the stack group is valid and click Create Stack Group.

What to do next

After you create the stack group, you can view the stack group that you create within the administrator account on the Stack Groups page.

Click the name of the stack group. Click the Instances tab to view the status of the stack instances that you create within the execution account. If the stack instances are in the Current state, the stacks are deployed. In this case, you can log on to the ROS console with the execution account to view the stacks in the China (Hangzhou) and China (Beijing) regions.