Before you create an RDS instance or connect your application to one, confirm the network details of the Elastic Compute Service (ECS) instance that runs your application. RDS instances and ECS instances communicate over an internal network when they share the same Virtual Private Cloud (VPC) in the same region — internal network connections provide better security, throughput, and reliability than Internet connections.
How it works
Your application on an ECS instance connects to an RDS instance over the internal network. This requires both instances to be in the same region and the same VPC. Before you create the RDS instance, collect the following three values from your ECS instance:
| Information | Where to find it | Why you need it |
|---|---|---|
| Region | Top navigation bar in the ECS console | The RDS instance must be in the same region |
| Network type | Instance list in the ECS console | Must be VPC (not classic network) |
| VPC ID | Instance Details tab > Network Information section | The RDS instance must be in the same VPC |
Prerequisites
Before you begin, make sure you have:
-
An Alibaba Cloud account with access to the ECS console
-
An ECS instance where your application is deployed or will be deployed
Confirm your ECS instance network details
Step 1: Check whether your application runs on ECS
Determine whether your application is deployed — or will be deployed — on an ECS instance.
-
Yes — Continue to Step 2.
-
No — If you do not want to migrate your application to an ECS instance, create an RDS instance and connect to it over the Internet. See Create an ApsaraDB RDS for MySQL instance.
If your application runs outside Alibaba Cloud, consider migrating to ECS before creating your RDS instance. Internal network communication provides higher security, performance, and stability than Internet connections.
Step 2: Find your ECS instance
-
Log on to the ECS console. In the left-side navigation pane, click Instances.
-
In the top navigation bar, select the region where your ECS instance resides. The number in a blue circle shows how many ECS instances exist in that region.
If you have not created an ECS instance yet, see Create and manage an ECS instance by using the ECS console.

-
Find the ECS instance where your application is deployed or will be deployed. This is the instance you will connect to the RDS instance.

Step 3: View the region and network type
In the instance list, locate the Region and Network Type columns for your ECS instance.
If the network type is classic network, migrate the ECS instance to a VPC before proceeding. See Migrate ECS instances from the classic network to a VPC.
Record the region and confirm the network type is VPC.
Step 4: View the VPC ID
-
Click the instance ID to open the instance details page.

-
On the Instance Details tab, scroll to the Network Information section. Record the VPC ID and VPC name.

You now have the three values needed — region, network type (VPC), and VPC ID — to create an RDS instance in the same VPC as your ECS instance.