Step 2: Create a stack group

更新时间:
复制 MD 格式

If you want to automatically deploy stacks in specified accounts and regions, you can use the administrator account to create a stack group by using the self-managed permission model. This way, Resource Orchestration Service (ROS) uses self-managed permissions to deploy stacks within the accounts and regions.

Prerequisites

The self-managed permissions are granted. For more information, see Step 1: Grant self-managed permissions.

Background information

Before you create a stack group, you must make sure that the following accounts are available:

  • Administrator account (Account A): the account within which you create a stack group.

  • Execution account (Account B): the account into which you deploy stacks in your stack group.

Note

The administrator account and the execution account can be the same Alibaba Cloud account. For more information about administrator and execution accounts, see Overview.

This topic describes how to create a stack group to deploy stacks. In this example, the stack group is created within Account A. The stacks are deployed within Account B in the China (Hangzhou) and China (Beijing) regions.

Procedure

  1. Log on to the ROS console using the administrator account (Account A).

  2. In the navigation pane on the left, click Stack Groups.

  3. In the top navigation bar, select the region where you want to create a stack group from the region drop-down list.

  4. On the Stack Groups page, click Create Stack Group.

  5. Specify a template as required and click Next.

    Select a Template Import Method and configure the template.

    • Enter Template Content: In the Template Content section, enter a ROS or Terraform template. For more information about how to write a template, see ROS template structure and Terraform template structure.

    • My Templates: Select an existing template and template version. The system automatically populates the template content. For more information about how to create a template, see Create a template and Create an infrastructure graph template.

    • Use URL: Enter the URL of the template and click Get Template Content. The system automatically populates the template content.

      If you want to use the URL of a ROS template file that is stored in an Object Storage Service (OSS) bucket, you must configure cross-domain access. For more information, see Configure cross-domain access for ROS templates.

    • Public Templates: Select a public template. The system automatically populates the template content.

    • Shared Templates: Select a template and template version that another user shared with you. The system automatically populates the template content. For more information about how to share a template, see Share a template with an Alibaba Cloud account.

  6. On the Configure Parameters page, enter the Stack Group Name and Stack Group Description, and then click Next.

  7. On the Configure Stack Group page, select Self-managed Permissions, set the Admin Role (AliyunROSStackGroupAdministrationRole) and the Execution Role (AliyunROSStackGroupExecutionRole), and then click Next.

    Note

    The administrator role and the execution role are the Resource Access Management (RAM) roles that you created for the administrator and execution accounts when you granted self-managed permissions. For more information, see Step 1: Grant self-managed permissions.

  8. On the Set Deployment Options page, configure the following parameters and click Next.

    Note

    The parameters that you must configure vary based on the template you use. Follow the on-screen instructions to configure the parameters.

    Parameter

    Description

    Accounts

    The accounts within which you want to deploy stacks.

    Set the Deployment Locations parameter to one of the following values and enter values in the Accounts field based on your business requirements:

    • Deploy Stacks Within Accounts: If you use an Alibaba Cloud account to create the stack group, you can select this option to deploy stacks in other Alibaba Cloud accounts. For example, enter the ID of the execution account (Account B) to deploy stacks in that account.

      Note

      If you enter multiple account IDs, separate the IDs with commas (,). You can also enter the ID of Account A in the Accounts field to deploy stacks within Account A.

    • Deploy Stacks Within Resource Directories: If you have enabled resource directory and are using a management account to create the stack group, you can select this option. Then, you can select folders from your resource directory to deploy stacks in all member accounts within those folders.

    Region

    The regions where you want to deploy stacks. Examples: China (Hangzhou) and China (Beijing).

    Note

    You can select up to 20 regions.

    Resource Group

    The resource group that you want to use to manage the stack group.

    Select the resource group to which you want to add the stack group based on your business requirements. If you do not select a resource group, 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.

    Tags

    Add tags to or remove tags from resources. You can add up to 20 tags to each resource.

    Maximum Number of Concurrent Accounts

    The maximum number of accounts within which stacks are deployed at the same time in each region.

    For more information about how to specify the value, see Overview.

    Fault Tolerance

    The number of accounts within which stack operation failures are allowed in each region. If the value of this parameter is exceeded in a region, ROS stops the operation in the region. If the operation is stopped in one region, the operation is no longer performed in other regions.

    For more information about how to specify the value, see Overview.

    Region Concurrency

    The mode that you want to use to deploy stack instances across regions.

    • Sequential: deploys stack instances in each specified region based on the specified sequence of regions. ROS deploys stack instances in one region at a time.

    • Parallel: deploys stack instances in parallel in all specified regions.

    Whether to Expand Modules in Current Account

    This parameter takes effect only when modules are used in the template. If you want to expand modules within the current account, the modules must exist in the current account. If you want to expand modules within execution accounts, the modules must exist in the execution accounts.

    Note

    If you do not specify Accounts and Region, ROS creates the stack group but no stack instances. To deploy stacks in specific accounts and regions, you must create stack instances separately. For more information, see Step 3 (Optional): Create stack instances.

  9. On the Check and Confirm page, verify the stack group information and click Create Stack Group.

Check the result

After the stack group is created, you can view it in the administrator account (Account A) on the Stack Groups page.

Click the stack group name and then click the Instance tab to view the status of the stack instances in the execution account (Account B). A status of Current indicates that the stacks were deployed successfully. You can then use the execution account (Account B) to log on to the ROS console and view the deployed stacks in the China (Hangzhou) and China (Beijing) regions.

References