Connect a DataWorks workspace to an Alibaba Cloud data source that belongs to a different Alibaba Cloud account by establishing cross-account virtual private cloud (VPC) connectivity. This topic uses ApsaraDB RDS for MySQL as an example.
Use cases
Apply this solution when both of the following conditions are true:
-
Different accounts: The data source and the DataWorks workspace belong to different Alibaba Cloud accounts.
-
Alibaba Cloud data source: The data source is an Alibaba Cloud product.
Solution overview
When the data source and the DataWorks workspace are in different Alibaba Cloud accounts, connect them over a VPC private network. Use a network connectivity tool — either Cloud Enterprise Network (CEN) or a VPC Peering Connection — to link the VPC of the data source in Account A to the VPC of the DataWorks resource group in Account B.
Prerequisites
Before you begin, make sure that you have:
-
A supported Alibaba Cloud data source
-
A resource group that is attached to the workspace
-
Both use-case conditions met (different accounts, Alibaba Cloud data source)
-
Cross-account authorization configured in the data source's Alibaba Cloud account
Billing
Charges depend on the networking product you choose. For pricing details, see the billing documentation for Cloud Enterprise Network (CEN) or VPC Peering Connection.
If you use a VPC Peering Connection and the data source and the DataWorks resource group are in different accounts but in the same region, no fees are charged.
Configure network connectivity
The steps below describe the general configuration flow. For a complete walkthrough with specific values, see the Configuration example section.
Step 1: Collect basic information
Data source side
-
Account: Account A (in this example)
-
Region: The region where the data source is located. In this example, ApsaraDB RDS for MySQL is in the China (Hangzhou) region.
-
VPC and vSwitch information:
-
Go to the ApsaraDB RDS console, find the target instance, and click the instance name to open the Basic Information page.
-
In the left-side navigation pane, click Database Connection to view the VPC and vSwitch details.

NoteThe steps below apply to ApsaraDB RDS for MySQL. For other Alibaba Cloud products, refer to the respective product documentation to find VPC information.
-
DataWorks side
-
Account: Account B (in this example)
-
Region: The region where the DataWorks workspace and resource group are located. In this example, China (Shanghai).
-
Resource group's bound VPC and vSwitch information:
-
Go to the resource group list page in DataWorks, find the target resource group, and click Network Settings in the Actions column.
-
In the relevant module, view the bound VPC and vSwitch information. For data synchronization scenarios, check the VPC and vSwitch under Data Scheduling & Data Integration.

-
Step 2: Establish the network connection
Choose a connectivity method based on your environment:
| Method | Best for |
|---|---|
| Cloud Enterprise Network (CEN) | Complex enterprise networks, interconnecting multiple VPCs |
| VPC Peering Connection | Point-to-point connectivity between two VPCs |
For configuration steps, see Cloud Enterprise Network (CEN) or VPC Peering Connection.
If you encounter issues while establishing the connection, submit a ticketsubmit a ticket to contact technical support for the relevant cloud product.
Step 3: Add a route to the resource group
When DataWorks accesses a data source in a different account, add a route in the DataWorks resource group that points to the CIDR block of the data source's vSwitch.
-
Go to the resource group list page in DataWorks, find the target resource group, and click Network Settings in the Actions column.
-
In the relevant module, find the bound VPC and click Custom Route in the Actions column.
-
Click Add Route, select CIDR Block as the connection method, and set Destination CIDR Block to the vSwitch CIDR block of the data source.
Step 4: (Optional) Configure the whitelist
If the data source is protected by an IP address whitelist, add the CIDR block of the vSwitch bound to the DataWorks resource group to the data source's whitelist.
For ApsaraDB RDS for MySQL, go to the Whitelist and SecGroup tab and add the vSwitch CIDR block of the DataWorks resource group in Account B. For other Alibaba Cloud products, see the respective product documentation.
Verify network connectivity
-
Log on to the DataWorks console. In the top navigation bar, select the target region. In the left-side navigation pane, choose Data Integration > Data Integration. Select the target workspace and click Go to Data Integration.
-
In the left-side navigation pane, click Data Source. On the data source list page, click Add Data Source, select the data source type, and configure the connection parameters.
-
In the resource group list at the bottom, select the target resource group and click Test Network Connectivity.
NoteIf the result is Cannot connect, use the Network Connectivity Diagnosis Tool to troubleshoot. If the connection still fails, submit a ticket.

Configuration example
This example walks through establishing network connectivity between an ApsaraDB RDS for MySQL instance in Account A (China (Hangzhou) region) and a DataWorks workspace in Account B (China (Shanghai) region).
1. Basic information
|
Parameter |
Data source (ApsaraDB RDS for MySQL) |
DataWorks resource group |
|
Account |
Account A |
Account B |
|
Region |
China (Hangzhou) |
China (Shanghai) |
|
VPC |
|
|
2. Establish the network connection
Use either Cloud Enterprise Network (CEN) or a VPC Peering Connection to connect the two VPCs. Follow the steps for your chosen method.
If you encounter issues while establishing the connection, submit a ticket to contact technical support for the relevant cloud product.
Cloud Enterprise Network (CEN)
-
Log on to Account B, go to the CEN console, and click Create CEN Instance. Set the instance Name and click Confirm.
NoteCreate the CEN instance in the same account as DataWorks (Account B) for centralized management.
-
In the dialog box, clickCreate Connectionand configure the network information for the DataWorks resource group. The following table lists the key parameters. Use the default values for parameters not listed.
Parameter
Description
Instance type
This solution describes cross-account VPC connectivity. Select VPC Interconnection.
Region
Select the region where the resource group is located. In this example, select China (Shanghai).
Resource Owner UID
Select Current Account.
VPC
Select the VPC where the DataWorks resource group is located.
vSwitch
Select the vSwitch where the resource group is located. In this example, select
Account_B_Switch_sh_e.NoteCEN connections require zone-level disaster recovery, so you must configure at least two vSwitches in different zones. After ensuring the resource group's vSwitch is included, add another vSwitch from any available zone. If you have fewer than two vSwitches, go to the vSwitch console to create one before proceeding.
-
Click Create.
-
Authorize the cross-account VPC.
-
Log on to Account A, go to the VPC console, and find the data source's VPC (
Account_A_hangzhou_VPCin this example). Click the VPC name to open the Basic Information page. -
Switch to theCross-account Authorizationtab, clickCEN, and configure the following parameters.
Parameter
Description
Peer account UID
The UID of the Alibaba Cloud account for Account B.
Peer CEN instance ID
The instance ID of the CEN instance that you created in step 1.
Payer
Select the party responsible for payment.
-
Peer Account UID (Default): The connection fee and data transfer fee are paid by the account that owns the CEN instance.
-
VPC Users: The connection fee and data transfer fee are paid by the account that owns the VPC.
This example uses the default value.
ImportantChoose the payer carefully. Changing the payer later may affect your services. For more information, see Authorize a network instance that belongs to another account.
-
-
Click OK.
-
-
Create a cross-account VPC connection.
-
Log on to Account B, go to the CEN console, and click the CEN instance ID to open the Basic Information page.
-
On theTransit Routertab, find the Transit Router and clickCreate Connectionin theActionscolumn. Configure the network information for the data source. The following table lists the key parameters. Use the default values for parameters not listed.
Parameter
Description
Instance type
This solution describes cross-account VPC connectivity. Select VPC Interconnection.
Region
Select the region where the data source is located. In this example, select China (Hangzhou).
Resource Owner UID
Select Cross-account and enter the UID of Account A in the UID field.
VPC
Select the VPC where the data source is located.
vSwitch
Select the vSwitch where the data source is located. In this example, select
Account_A_Switch_hz_h.NoteCEN connections require zone-level disaster recovery, so you must configure at least two vSwitches in different zones. After ensuring the data source's vSwitch is included, add another vSwitch from any available zone. If you have fewer than two vSwitches, go to the vSwitch console to create one before proceeding.
-
Click Create.
-
-
Create an inter-region connection.
-
Log on to Account B, go to the CEN console, and click the CEN instance ID to open the Basic Information page.
-
On theTransit Routertab, find the Transit Router forChina (Hangzhou)(the data source's region) and clickCreate Connectionin theActionscolumn. Configure the inter-region connection.
Parameter
Description
Region
Select China (Hangzhou).
Peer region
Select China (Shanghai).
-
Click OK.
NoteThis step is required only when the data source and DataWorks are in different regions. If they are in different accounts but the same region, skip this step.
-
After completing the CEN configuration, proceed to step 3 to add a route in the DataWorks resource group.
VPC Peering Connection
-
Log on to Account A, go to theVPC Peering Connection console, switch the region toChina (Hangzhou), and clickCreate Peering Connection. Configure the following parameters. The following table lists the key parameters. Use the default values for parameters not listed.
Parameter
Description
Peering connection name
Enter a custom name. In this example, enter
Account_A to Account_B.Requester VPC instance
Select the VPC where the data source (ApsaraDB RDS for MySQL) in Account A is located. In this example, select
Account_A_hangzhou_VPC.Accepter account type
Select
Cross-account.Accepter Alibaba Cloud account UID
Enter the UID of Account B.
Accepter region type
Select
Inter-region.Accepter region
Select the region of the DataWorks workspace and resource group in Account B. Select
China (Shanghai).Accepter VPC instance
Enter the VPC ID of the DataWorks resource group in Account B (
Account_B_shanghai_VPC). -
Click OK. The peering connection's Status is Pending Acceptance.
-
Log on to Account B, go to the VPC Peering Connection console, and switch the region to China (Shanghai). Find the pending peering connection and click Accept in the Actions column. The Status changes to Activated.
-
Under Accepter VPC instance, click Configure Route Entry. Enter a name for the route entry and set Destination CIDR Block to the requester's vSwitch CIDR block. In this example, enter
192.168.6.0/24.
-
Log on to Account A, go to the VPC Peering Connection console, and switch the region to China (Hangzhou). Find the peering connection you created.
-
Under Requester VPC instance, click Configure Route Entry. Enter a name for the route entry and set Destination CIDR Block to the accepter's vSwitch CIDR block. In this example, enter
172.16.66.0/24.
After completing the VPC Peering Connection configuration, proceed to step 3 to add a route in the DataWorks resource group.
3. Add a route to the resource group
-
Log on to Account B, go to the resource group list page in DataWorks, find the target resource group, and click Network Settings in the Actions column.
-
In the relevant module, find the bound VPC and click Custom Route in the Actions column.
-
Click Add Route, select CIDR Block as the connection method, and set Destination CIDR Block to the vSwitch CIDR block of the ApsaraDB RDS for MySQL instance in Account A. In this example, enter
192.168.6.0/24.
4. Configure the whitelist
Log on to Account A and add the vSwitch CIDR block of the DataWorks resource group to the Whitelist and SecGroup of the ApsaraDB RDS for MySQL instance. In this example, the CIDR block is 172.16.66.0/24.
5. Test connectivity
Before testing, make sure cross-account authorization is configured in Account A (the data source's account).
-
Log on to Account B.
-
Log on to the DataWorks console. In the top navigation bar, select the target region. In the left-side navigation pane, choose Data Integration > Data Integration. Select the target workspace and click Go to Data Integration.
-
In the left-side navigation pane, click Data Source. On the Data Source List page, click Add Data Source.
-
Select the MySQL data source type and configure the data source information:
-
Configuration Mode: Select Alibaba Cloud Instance Mode.
-
Alibaba Cloud Account: Select Another Alibaba Cloud Account.
-
ID of Another Alibaba Cloud Account: Enter the UID of Account A.
-
Role Assigned to RAM User: Enter the RAM role name configured in Account A. For details, see Cross-account authorization.
-
Region: Select China (Hangzhou).
-
Instance: Select the ApsaraDB RDS for MySQL instance in Account A for which you configured network connectivity.
-
-
In the Connection Configuration section, click Test Network Connectivity next to the resource group bound to the workspace. Verify the result is Connected.
NoteIf the test fails, use the Network Connectivity Diagnosis Tool to troubleshoot. If the connection still fails, submit a ticket.

Related topics
For frequently asked questions about network connectivity in DataWorks, see Resource group operations and network connectivity.
