This topic uses ApsaraDB RDS as an example to describe how to connect an exclusive resource group for Data Integration to a data store that is deployed in a virtual private cloud (VPC).

Prerequisites

Background information

Assume that a data store has no public endpoint and resource groups for Data Integration cannot connect to the data store by using a VPC. When you configure a connection to the data store, the shared resource group or an exclusive resource group for Data Integration fails the connectivity test. This topic describes how to connect an exclusive resource group for Data Integration to a data store that is deployed in a VPC.

Procedure

  1. Obtain the information about the ApsaraDB RDS for MySQL instance.
    When you configure a connection to a database in the ApsaraDB RDS for MySQL instance, you must provide the instance ID, database name, username, and password.
    1. Log on to the ApsaraDB RDS console.
    2. In the left-side navigation pane, click Instances.
    3. On the Instances page, find the required instance and obtain the instance ID.
    4. Find the required instance and click Manage.
    5. In the left-side navigation pane, click Databases. On the page that appears, find the database to which you want to create a connection and obtain the database name.
    6. In the left-side navigation pane, click Accounts. Then, obtain the username of the account that you can use to connect to the database. You can enter the username when you create a connection to the database.
  2. Create an exclusive resource group for Data Integration.
    1. Log on to the DataWorks console.
    2. Select a region. In the left-side navigation pane, click Resource Groups.
    3. On the Exclusive Resource Groups tab, click Create a dedicated resource group.
    4. In the Create a dedicated resource group panel, set the Resource Group Type parameter to Exclusive Resource Groups for Data Integration. Then, click Purchase next to Order Number to go to the buy page.
      Purchase
    5. On the buy page, set the Region, Type, Exclusive data integration resources, Units, and Duration parameters as required. Then, click Buy Now.
      In this example, the ApsaraDB RDS for MySQL instance is purchased in the China (Shanghai) region. Therefore, you must set the Region parameter to China (Shanghai). You can select specifications for the exclusive resource group for Data Integration based on your needs. For more information, see Performance metrics and billing standards of exclusive resource groups for Data Integration.
    6. After you confirm that the order information is correct, read and agree to DataWorks Exclusive Resources Agreement of Service by selecting the check box and click Pay.
    7. Go back to the Create a dedicated resource group panel and set the parameters as required.
      Parameter Description
      Resource Group Type The type of the resource group. In this example, select Exclusive Resource Groups for Data Integration.
      Resource Group Name The name of the resource group. The name must be unique within all resource groups of a tenant.
      Note A tenant indicates an Alibaba Cloud account. Multiple RAM users may exist for a tenant.
      Resource Group Description The description of the resource group.
      Order Number The order number of the exclusive resources that you purchase.
    8. Click OK.
  3. Bind the exclusive resource group for Data Integration to the VPC.
    1. On the Exclusive Resource Groups tab of the Resource Groups page, find the exclusive resource group for Data Integration and click Add VPC Binding.
      Notice Before you bind the exclusive resource group for Data Integration to the VPC as a RAM user, make sure that the RAM user is authorized to access the ApsaraDB RDS for MySQL instance.
    2. Click Add Binding in the upper-right corner. In the Add VPC Binding panel, set the parameters as required.
      Add Binding
      Parameter Description
      Resource Group Name Select the resource group that you want to bind to the VPC from the Resource Group Name drop-down list.
      VPC Select the VPC where the ApsaraDB RDS for MySQL instance is deployed from the VPC drop-down list.
      VSwitch Select the vSwitch where the ApsaraDB RDS for MySQL instance resides from the VSwitch drop-down list.
      Security Groups Select the required security group from the Security Groups drop-down list.
    3. Click OK.
  4. Optional:Add a route to the VPC.
    The exclusive resource group for Data Integration must be in the same zone as the ApsaraDB RDS for MySQL instance. If they are in the same zone, skip this step. If they are in different zones, you must add a route.
    1. On the Exclusive Resource Groups tab, find the exclusive resource group for Data Integration and click Add VPC Binding.
    2. Find the required resource group and click Custom Route.
    3. In the Custom Route panel, click Add Route.
    4. In the Add Route dialog box, set the parameters as required.
      Add Route
      Parameter Description
      Destination Type The data store in this example is deployed in the VPC. Set this parameter to VPC.
      Destination VPC The region and name of the VPC where the data store is deployed.
      Note This parameter is displayed only when the Destination Type parameter is set to VPC.
      Connection Method Valid values: Switch, Fixed IP Address, and CIDR Block. In this example, set this parameter to Switch.
      Destination VSwitch Select a specific vSwitch in the VPC as the destination vSwitch for routing.
      Routing By default, the value cannot be changed.
    5. Click Generate Route.
  5. Add the elastic IP address (EIP) and the elastic network interface (ENI) IP address of the exclusive resource group for Data Integration to the whitelist that allows access to the ApsaraDB RDS for MySQL instance.
    1. On the Exclusive Resource Groups tab, find the exclusive resource group for Data Integration and click View Information.
    2. In the Exclusive Resource Groups dialog box, view the EIP that is indicated by the EIPAddress parameter.
      EIPAddress
    3. On the Exclusive Resource Groups tab of the Resource Groups page, find the exclusive resource group for Data Integration and click Add VPC Binding.
    4. On the details page of the resource group, view the ENI IP address in the ENI IP Address column.
      ENI IP Address
    5. Log on to the ApsaraDB RDS console.
    6. In the upper-left corner of the Instances page, check whether the selected region is the region where the ApsaraDB RDS for MySQL instance resides. If not, select the required region. Find the ApsaraDB RDS for MySQL instance and click Manage.
    7. In the left-side navigation pane, click Data Security.
    8. On the Data Security page, click Create Whitelist.
    9. In the Create Whitelist dialog box, set the parameters as required and click Add.
      Create Whitelist
      Parameter Description
      Network Isolation Mode By default, the value cannot be changed.
      Whitelist Name The name of the whitelist. The name must comply with the following conventions:
      • It consists of lowercase letters, digits, and underscores (_).
      • It must start with a lowercase letter and end with a digit or lowercase letter.
      • It must be 2 to 32 characters in length.
      IP Addresses Use the EIP and ENI IP address of the exclusive resource group for Data Integration.
  6. Create a connection to the specified database in the ApsaraDB RDS for MySQL instance and test the connectivity.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. After you select the region where the required workspace resides, find the workspace and click Data Integration.
    4. In the left-side navigation pane, click Connection to go to the Data Source page.
    5. On the Data Source page, click New data source in the upper-right corner.
    6. In the Add data source dialog box, select MySQL as the connection type.
    7. In the Add MySQL data source dialog box, set the parameters as required.
      You can set the Data source type parameter to Alibaba Cloud instance mode or Connection string mode. In this example, select Alibaba Cloud instance mode.
      Parameter Description
      Data source type The type of the connection. Set this parameter to Alibaba Cloud instance mode.
      Data Source Name The name of the connection. The name can contain letters, digits, and underscores (_), and must start with a letter.
      Data source description The description of the connection. The description can be up to 80 characters in length.
      Environment Valid values: Development and Production.
      Note This parameter is displayed only when the workspace is in standard mode.
      Region The region of the ApsaraDB RDS for MySQL instance.
      RDS instance ID The ID of the ApsaraDB RDS for MySQL instance.
      RDS instance account ID The ID of the Alibaba Cloud account that is used to purchase the ApsaraDB RDS for MySQL instance. Log on to the DataWorks console. Move the pointer over the profile picture in the upper-right corner and select Security Settings. Then, view the ID of your Alibaba Cloud account.
      Database name The name of the database.
      User name The username that is used to log on to the database.
      Password The password that is used to log on to the database.
    8. On the Data Integration tab, find the required resource group and click Test connectivity.
    9. After the connection passes the connectivity test, click Complete.