ApsaraDB for MongoDB uses a virtual private cloud (VPC) as its default network type. This topic explains how to select a VPC when creating a new ApsaraDB for MongoDB instance.
Before you begin
Choose the path that fits your situation:
| Situation | Action |
|---|---|
| No existing ApsaraDB for MongoDB instance | Create a VPC first, then create an instance in that VPC — follow this topic |
| Instance already exists | Create a VPC in the same region, then migrate the instance to it — see Switch the network type |
Prerequisites
Before you begin, make sure that you have:
A VPC in the same region where you plan to create the ApsaraDB for MongoDB instance. To create one, see Create and manage a VPC
A vSwitch in that VPC
Note The ApsaraDB for MongoDB instance and the VPC must be in the same region. You cannot change the region after the instance is created.
Network types
ApsaraDB for MongoDB supports two network types:
| Network type | Description |
|---|---|
| Classic network | Cloud services share the same network and are not isolated from each other. Access control relies on security groups or whitelist policies. |
| VPC | Provides an isolated private network in Alibaba Cloud. You can customize the route table, IP address range, and gateway, and connect your on-premises data center to Alibaba Cloud resources using a physical connection or VPN. |
VPC is the default network type for ApsaraDB for MongoDB.
Create an instance in a VPC
Log on to the ApsaraDB for MongoDB console and click Create Instance.
Set Network Type to VPC.
Configure the VPC and vSwitch fields:
Parameter Description VPC Select the VPC where you want the instance to run. Only VPCs in the same region as the instance are listed. vSwitch Select a vSwitch within the chosen VPC. The vSwitch determines the zone and IP address range for the instance. Configure the remaining instance parameters based on your deployment type: