You can use a Resource Orchestration Service template to automatically create an ApsaraDB for MongoDB instance.
Resource architecture

The template creates a VPC and a vSwitch in a specified region, and then creates a MongoDB replica set instance.
Permissions
By default, Resource Orchestration Service uses the credentials of the user who is logged on to the console. Ensure that this user has the following MongoDB to create a Virtual Private Cloud (VPC), a vSwitch, and an MongoDB instance:
-
AliyunROSFullAccess: Grants permissions to manage Resource Orchestration Service.
-
AliyunVPCFullAccess: Grants permissions to manage Virtual Private Cloud.
-
AliyunMongoDBFullAccess: Grants permissions to manage ApsaraDB for MongoDB.
Procedure
-
Log on to the Resource Orchestration Service (ROS) console. In the top navigation bar, select the target region from the Region drop-down list.
-
In the navigation pane on the left, click Stacks. On the Stacks page, choose .
-
Under Specify template, select Select an existing template.
-
For Template import method, select Enter template content.
-
-
In the Template content section, select ROS and enter the following code.
The following topics describe the instance resources used in the template:
-
For the syntax and examples of creating a replica set instance, see ALIYUN::MONGODB::Instance.
-
For the syntax and examples of creating a sharded cluster instance, see ALIYUN::MONGODB::ShardingInstance.
-
-
Click Next and configure the parameters on the Configure template parameters page.
-
Click Create to deploy the stack.
-
Verify the result.
On the Resources tab of the stack details page, verify that the status of the ApsaraDB for MongoDB instance (ALIYUN::MONGODB::Instance), vSwitch (ALIYUN::ECS::vSwitch), and VPC (ALIYUN::ECS::VPC) resources is Create Succeeded.