This topic uses an ApsaraDB RDS for MySQL instance as an example to explain how to connect a DataWorks workspace to a data source in a different region within the same Alibaba Cloud account.
Use cases
Use this solution if your data source and DataWorks workspace meet all the following conditions:
The data source is an Alibaba Cloud product.
The data source and the DataWorks workspace belong to the same Alibaba Cloud account.
The data source and the DataWorks workspace are in different regions.
Solution overview
In a scenario where the data source and workspace are in the same account but different regions, you can use a VPC (private network) connection. You can use a network connectivity tool, such as CEN or a VPC peering connection, to connect the VPC of the DataWorks resource group to the VPC of the data source. This enables network communication.
Prerequisites
An Alibaba Cloud data source that DataWorks supports is available.
Your data source and DataWorks workspace meet the conditions described in the Use cases section.
Billing
Charges vary depending on the networking product you choose. For more information, see the billing details for Cloud Enterprise Network (CEN) or Peering Connection.
Configure network connectivity
The following steps outline the general process of connecting your data source to DataWorks and explain the core networking logic. For detailed, step-by-step instructions, see the configuration example in this topic.
Step 1: Obtain basic information
For the data source
Region: This example uses an ApsaraDB RDS for MySQL instance in the China (Hangzhou) region.
VPC and vSwitch information:
NoteTo find VPC information for other Alibaba Cloud services, see the official documentation for the specific service.
Go to the ApsaraDB RDS console, locate the target Instance, and click its Instance Name to access the Basic Information page.
In the left-side navigation pane, click Database Connection to view the VPC and vSwitch information for the ApsaraDB RDS for MySQL instance.

For DataWorks
Region: This example uses a DataWorks workspace and resource group in the China (Shanghai) region.
VPC and vSwitch information for the resource group:
Go to the DataWorks resource group list page, find the target resource group, and click Network Settings in the Actions column.
View the bound VPC and vSwitch information in the appropriate module.
For example, to synchronize data, find this information under Data Scheduling & Data Integration.

Step 2: Establish the network connection
To connect VPCs across different regions, use a networking product. Choose one of the following options based on your needs:
Cloud Enterprise Network (CEN): Suitable for complex enterprise networks and interconnecting multiple VPCs. For configuration details, see Connect VPCs across regions.
Peering Connection: Suitable for connecting two VPCs. For configuration details, see Use a Peering Connection to enable Private Network communication between VPCs.
If you encounter issues while establishing the network connection, submit a ticket to contact technical support for the relevant cloud product.
Step 3: Add a route to the resource group
To access a cross-region data source, add a route in the DataWorks resource group that points to the vSwitch CIDR block of the data source.
Go to the DataWorks Resource Group list page, find the target resource group, and click Network Settings in the Actions column.
In the relevant feature module, find the bound VPC and click Custom Route in the Actions column.
Click Add Route. For the connection method, select CIDR block. Set Destination CIDR block to the CIDR block of the data source's vSwitch.
Step 4: (Optional) Configure the whitelist
If your data source uses a whitelist for access control, add the CIDR block of the resource group's vSwitch to the data source's whitelist to grant access.
For example, to Configure an IP Whitelist for an ApsaraDB RDS for MySQL Instance, add the vSwitch CIDR block of the DataWorks resource group to the Whitelist and SecGroup settings.
For other Alibaba Cloud services, see their official documentation for instructions on whitelist configuration.

Verify network connectivity
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, select the desired workspace from the drop-down list and click Go to Data Integration.
In the left-side navigation pane, click Data Source. On the Data Sources page, click Add Data Source. Select the appropriate data source type and configure the connection parameters.
In the resource group list at the bottom, select the resource group connected to the data source and click Test Network Connectivity.
NoteIf the connectivity test fails, you can use the Network Connectivity Diagnosis Tool to troubleshoot the issue. If you still cannot connect the resource group to the data source, submit a ticket for assistance.
Configuration example
This example shows how to connect an ApsaraDB RDS for MySQL instance in China (Hangzhou) to a DataWorks workspace in China (Shanghai) within the same Alibaba Cloud account.
1. Basic information
Parameter | Data source (RDS for MySQL) | DataWorks resource group |
Account | Same account | |
Region | China (Hangzhou) | China (Shanghai) |
VPC |
|
|
2. Establish the network connection
This solution supports using Cloud Enterprise Network (CEN) and Peering Connection to connect your data source to DataWorks. You can choose either method.
If you encounter issues while establishing the network connection, submit a ticket to contact technical support for the relevant cloud product.
Connect with CEN
Go to the Cloud Enterprise Network console and click Create CEN Instance.
In the Create CEN Instance dialog box, switch to the Create Scenario-specific CEN (Recommended) tab. Select the VPC Interconnection scenario and click Create.
NoteThe VPC Interconnection scenario is suitable for connecting VPCs within the same account, regardless of the region.
In the Configure Networking Settings step, configure the network information for the data source and the DataWorks resource group.
In the first tab, configure the network information for the data source:

Region: China (Hangzhou)
VPC:
VPC: Select the VPC where the data source is located. For this example, select
vpc-hangzhou.vSwitch: Select the vSwitch where the data source is located. For this example, select
hz-h.NoteFor high availability, CEN requires you to attach vSwitches from at least two different availability zones. Make sure you select the vSwitch where your data source resides. Then, select another vSwitch in a different availability zone. If you do not have one, click Create VSwitch in the drop-down list to create a new one.
Click + to add a new tab and configure the network information for the DataWorks resource group:

Region: China (Shanghai)
VPC:
VPC: Select the VPC where the DataWorks resource group is located. For this example, select
vpc-shanghai.vSwitch: Select the vSwitch where the resource group is located. For this example, select
sh-l.NoteFor high availability, CEN requires you to attach vSwitches from at least two different availability zones. Make sure you select the vSwitch where your resource group resides. Then, select another vSwitch in a different availability zone. If you do not have one, click Create vSwitch in the drop-down list to create a new one.
Click Next. CEN automatically generates the Networking Settings and Billing Details. After reviewing them, click Start Deployment.
Wait for the deployment to complete.
ImportantDo not close the page before the deployment is complete.
Connect with a peering connection
Go to the Peering Connection console. At the top of the page, switch the region to China (Hangzhou), and then click Create Peering Connection. Configure the parameters.
The following table describes the key parameters for this example. You can keep the default values for any parameters not mentioned.
Parameter
Configuration and example
Peering Connection Name
Enter a custom name. This example uses
connect-hangzhou-shanghai-vpc.Requester VPC
Select the VPC where the ApsaraDB RDS for MySQL Data Source is located. This example uses
vpc-hangzhou.Accepter Account Type
This example uses
Same account.Accepter Region Type
This example uses
Cross-region.Accepter Region
Select the region where the DataWorks workspace and Resource Group are located. This example uses
China (Shanghai).Accepter VPC
Select the VPC where the DataWorks Resource Group is located. This example uses
vpc-shanghai.Click OK to complete the peering connection configuration.
In the Peering Connection console, find the Peering Connection you created. Click Configure Route under both the Requester VPC and Accepter VPC columns.

For the requester VPC's route (pointing to the Accepter): Enter a Name, and set Destination CIDR block to the Accepter's vSwitch CIDR block. This example uses
172.16.0.0/24.For the Accepter VPC's route (pointing to the Requester): Enter a Name, and set Destination CIDR block to the Requester's vSwitch CIDR block. This example uses
192.168.6.0/24.
3. Add a route to the resource group
Go to the DataWorks Resource Group list page, find the target resource group, and click Network Settings in the Actions column.
In the relevant feature module, find the bound VPC and click Custom Route in the Actions column.
Click Add Route. For the connection method, select CIDR block. Set Destination CIDR block to the vSwitch CIDR block of the ApsaraDB RDS for MySQL instance, which is
192.168.6.0/24in this example.
4. Configure the whitelist
In the Whitelist and SecGroup settings for the ApsaraDB RDS for MySQL instance, add the vSwitch CIDR block of the DataWorks resource group. In this example, the CIDR block is 172.16.0.0/24.

5. Test the connectivity
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, select the desired workspace from the drop-down list and click Go to Data Integration.
In the left-side navigation pane, click Data Source to go to the Data Sources page, and then click Add Data Source.
Select the MySQL data source type and configure the connection information.
For Configuration Mode, select Alibaba Cloud Instance Mode.
For Region, select China (Hangzhou).
For Instance, select the ApsaraDB RDS for MySQL instance in China (Hangzhou) that you previously connected.
In the Connection Configuration section, click Test Network Connectivity for the bound resource group. A Connected status indicates a successful connection.
NoteIf the connectivity test fails, you can use the Network Connectivity Diagnosis Tool to troubleshoot the issue. If you still cannot connect the resource group to the data source, submit a ticket for assistance.
Related documents
For frequently asked questions about network connectivity, see Resource group operations and network connections.


