Use Resource Orchestration Service (ROS) stack groups to create identically configured VPCs across multiple regions within a single Alibaba Cloud account.
Prerequisites
-
If you use the self-managed permission model to create a stack group, create an administrator account and one or more execution accounts, and manually create RAM roles in both to establish a trust relationship. For more information, see Authorize self-managed permissions.
-
If you use the service-managed permission model to create a stack group, configure a delegated administrator account. For more information, see Set up a delegated administrator account.
Step 1: Prepare a template
ROSTemplateFormatVersion: '2015-09-01'
Description: Creates One VPC instance
Parameters:
CidrBlock:
Type: String
AllowedValues:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
Label: VPC CIDR Block
Default: 192.168.0.0/16
VpcName:
Type: String
Label: VPC Name
ConstraintDescription: '[2, 128] English or Chinese characters'
MinLength: 2
MaxLength: 128
Default: MyVPC
Resources:
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: CidrBlock
VpcName:
Ref: VpcName
Outputs:
VpcId:
Value:
Fn::GetAtt:
- Vpc
- VpcId
Template description:
-
The
Parameterssection lets you specify the VPC name and CIDR block when you create stack instances. -
The
Resourcessection defines the VPC resource. -
The
Outputssection returns the created VPC ID throughVpcId.
Step 2: Create a stack group
-
Log on to the Resource Orchestration Service (ROS) console.
-
In the navigation pane on the left, click Stack Groups.
-
In the top navigation bar, select the region for the stack group from the drop-down list.
-
On the Stack Groups page, click Create Stack Group.
-
On the Select Template page, choose to use an existing template, set Template Import Method to Enter Template Content, and enter the YAML template from Step 1: Prepare a template.
-
On the Configure Parameters page, enter the Stack Group Name and Stack Group Description, configure the VPC parameters, and then click Next.
-
On the Configure Stack Group page, set the Permission Model to Service-managed Permissions or Self-managed Permissions, and then click Next.
For more information, see permission models.
-
On the Set Deployment Options page, configure the deployment parameters, and then click Next.
-
When you use the service-managed permission model to create a stack group, you select a member in the Resource Directory for Deployment Destinations and select multiple regions.
Configure other parameters as needed. For more information, see Create a stack group by using the service-managed permission model.
-
When you use the self-managed permission model to create a stack group, for Deployment Locations, select Deploy Stacks Within Accounts, add an account, and select multiple regions.
Configure other parameters as needed. For more information, see Create a stack group by using the self-managed permission model.
NoteYou can select a maximum of 20 regions.
-
-
On the Check and Confirm page, verify the stack group information and click Create Stack Group.
Step 3: View the stack group
-
In the left navigation pane, click Stack Groups.
-
On the Stack Groups page, click the target Stack Group Name.
-
Click the Instance tab to view the created stack instances and their corresponding stack IDs.
-
Click a Stack ID. On the Resources tab, view the VPC information.
CREATE_COMPLETE in the Status column confirms that the VPC was created.