All Products
Search
Document Center

ApsaraDB for MongoDB:ROS integration example

Last Updated:Jun 23, 2026

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

Resource architecture

image.png

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

  1. Log on to the Resource Orchestration Service (ROS) console. In the top navigation bar, select the target region from the Region drop-down list.

  2. In the navigation pane on the left, click Stacks. On the Stacks page, choose Create stack > Use ROS.

    • Under Specify template, select Select an existing template.

    • For Template import method, select Enter template content.

  3. In the Template content section, select ROS and enter the following code.

    The following topics describe the instance resources used in the template:

  4. Click Next and configure the parameters on the Configure template parameters page.

  5. Click Create to deploy the stack.

  6. 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.