ApsaraDB for MongoDB supports two network types: classic network and VPC. This topic describes how to configure a VPC for a new ApsaraDB for MongoDB instance.
On the Apsara Stack, a classic network and a VPC network have the following differences:
- On the classic network, cloud services are not isolated. You can configure a security group or whitelist policy for cloud services to block unauthorized access.
- A VPC allows you to build an isolated network environment in Alibaba Cloud, where you can customize its route table, IP address range, and gateway. You can also use a physical connection or VPN to combine your self-managed data center with cloud resources in Alibaba Cloud VPC to create a virtual data center, so that you can migrate your applications to the cloud.
VPC is selected for ApsaraDB for MongoDB by default. Then, you must create an ApsaraDB for MongoDB instance and a VPC in the same region in the following ways:
- If you have not created an ApsaraDB for MongoDB instance, you can create a VPC first and create an ApsaraDB for MongoDB instance in the VPC by using the method described in this topic.
- If you have created an ApsaraDB for MongoDB instance, you can create a VPC in the same region and add the ApsaraDB for MongoDB instance to the VPC. For more information, see Switch the network type of an ApsaraDB for MongoDB instance.
- Create a VPC. For more information, see Create and manage a VPC.
- Create an ApsaraDB for MongoDB instance in the same region as the VPC.
- Set Network Type to VPC after you click Create Instance.
- Specify VPC and vSwitch after you select VPC, as shown in the following figure.
- Configure other parameters on the page. For more information, see