Step 2: Create a stack group
If you want to create a stack in a specified account and region, you can use an administrator account to create a self-managed permission mode stack group. ROS will deploy the stack in the specified account using self-managed permissions.
Prerequisites
Please confirm that you have granted self-managed permissions. For more information, see Step 1: Grant self-managed permissions.
Background information
When you create a stack group, prepare the following accounts:
Administrator account (Account A): the account used to create the stack group.
Execution account (Account B): the account into which the stacks are deployed.
The administrator and execution accounts can be the same Alibaba Cloud account. Overview explains the account roles.
This topic uses the example where the administrator account (Account A) creates a stack group and deploys stacks for the execution account (Account B) in the China (Hangzhou) and China (Beijing) regions.
Procedure
Use the administrator account (Account A) to log on to the ROS console.
In the left-side navigation pane, click Stack Groups.
In the top navigation bar, select the region where you want to create the stack group from the region drop-down list.
On the Stack Groups page, click Create Stack Group.
-
Specify the template 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 template content is automatically populated. For more information about how to create a template, see Create a template and Create an architecture diagram template.
-
Use URL: Enter the URL of the template and click Get Template Content. The template content is automatically populated.
To use the URL of a ROS template file stored in an OSS bucket, configure cross-origin resource sharing (CORS). For more information, see Access ROS templates across domains.
-
Public Templates: Select a public template. The template content is automatically populated.
-
Shared Templates: Select a template and template version shared by another user. The template content is automatically populated. For more information about how to share a template, see Share a template with an Alibaba Cloud account.
-
On the Configure Parameters page, enter the Stack Group Name and Stack Group Description, and then click Next.
On the Configure Stack Group page, select Self-managed Permissions, and then set the Admin Role (AliyunROSStackGroupAdministrationRole) and the Execution Role (AliyunROSStackGroupExecutionRole), and then click Next.
NoteThe Admin Role and the Execution Role in this step are the administrator role and the execution role. Both roles are the Resource Access Management (RAM) roles created when you grant self-managed permissions. For more information, see Step 1: Grant self-managed permissions.
On the Set Deployment Options page, configure the following parameters and then click Next.
NoteThe parameters that you must configure vary based on the template. Follow the on-screen instructions.
Parameter
Description
Accounts
The accounts into which stacks are deployed.
Select one of the following deployment locations and configure the accounts based on your business requirements.
Deploy Stacks Within Accounts: When you use an Alibaba Cloud account to create a stack group, select this option to deploy stacks in other Alibaba Cloud accounts that you identify by account ID. For example, enter the ID of the execution account (Account B) to deploy stacks in Account B.
NoteYou can add multiple accounts. Separate multiple account IDs with commas (,). You can also add the administrator account (Account A) to deploy stacks in Account A.
Deploy Stacks Within Resource Directories: If you have enabled a resource directory and use the management account of the resource directory to create a stack group, select this option to deploy stacks in the resource directory. Then, select folders from the resource directory to deploy stacks in all member accounts within those folders.
Region
The regions where you want to deploy stacks. These regions are the deployment regions, not the region of the stack group that you select in the top navigation bar. Examples: China (Hangzhou) and China (Beijing).
NoteYou can select up to 20 regions.
Resource Group
The resource group used to manage the stack group.
Select the resource group to which the stack group belongs based on your business requirements. If you do not specify 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 in which stacks can be deployed at the same time in each region.
For more information about how to set the maximum concurrent accounts, see Overview.
Fault Tolerance
The number of accounts in which stack operations can fail in each region. If the number of failed accounts in a region exceeds this value, ROS stops the operations in that region. If operations stop in one region, ROS does not continue the operations in the other regions.
For more information about how to configure fault tolerance, see Overview.
Region Concurrency
The region-level concurrency mode for deploying stack instances.
Sequential: deploys stack instances in each specified region one by one in the specified order. ROS deploys stack instances in only one region at a time.
Parallel: deploys stack instances in parallel across all specified regions.
Expand Modules in Current Account
This parameter takes effect only when modules are used in the template. If you expand modules in the current account, the modules must exist in the current account. Otherwise, the modules must exist in each execution account.
NoteIf you do not specify Accounts and Region, ROS creates only the stack group and does not create stack instances. To deploy stacks in specified accounts and regions, you must also create stack instances. For more information, see Step 3 (Optional): Create stack instances.
On the Check and Confirm page, verify the stack group information and click Create Stack Group.
Result
After the stack group is created, you can view the stack group in the administrator account (Account A) on the Stack Groups page. The stack group appears on this page whether or not you specified Accounts and Region.
If you specified Accounts and Region, 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 are deployed. (Optional) To confirm the deployment from the execution account, 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.