This topic describes how to create a Resource Orchestration Service (ROS) template to automatically create an ApsaraDB for MongoDB instance.
Resource architecture
You can create a virtual private cloud (VPC), a vSwitch, and a replica set instance in a specific region.
Required permissions
In this example, you must create a VPC, a vSwitch, and an instance. By default, Resource Orchestration Service uses the credentials of the current user who logs on to the ROS console. The current user must be granted the following permissions:
AliyunROSFullAccess: provides full access to Resource Orchestration Service.
AliyunVPCFullAccess: provides full access to Virtual Private Cloud.
AliyunMongoDBFullAccess: provides full access to ApsaraDB for MongoDB.
Procedure
Log on to the ROS console. In the top navigation bar, select a region from the Region drop-down list.
In the left-side navigation pane, click Stacks. On the Stacks page, choose
.Specify Template: Select Select an Existing Template.
Template Import Method: Select Enter Template Content.
Template Content: Select ROS and then enter code.
The code used to create an instance varies with the instance architecture.
For more information about the code that is used to create a replica set instance, see ALIYUN::MONGODB::Instance.
For more information about the code that is used to create a sharded cluster instance, see ALIYUN::MONGODB::ShardingInstance.
Click Next to go to the Configure Template Parameters step.
Click Create and execute the created stack.
View the result.