This topic uses ApsaraDB for 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 is inaccessible over a public endpoint and resource groups for Data Integration cannot connect to the data store over a VPC. When you configure a connection to the data store, the shared resource group or 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. To obtain the required information, perform the following steps:
    1. Log on to the ApsaraDB for RDS console.
    2. In the left-side navigation pane, click Instances.
    3. On the Instances page, find the instance and take note of the instance ID.
    4. Click Manage in the Actions column. The instance details page appears.
    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 take note of the database name.
    6. In the left-side navigation pane, click Accounts. On the page that appears, find the account that you want to use to connect to the database and take note of the username.
  2. Create an exclusive resource group for Data Integration.
    1. Log on to the DataWorks console.
    2. Select the China (Shanghai) region and click Resource Groups in the left-side navigation pane.
    3. On the Resource Groups page, click Create a dedicated resource group on the Exclusive Resource Groups tab.
    4. In the Create a dedicated resource group pane, select Exclusive Resource Groups for Data Integration for Resource Group Type and click Purchase next to Order Number to go to the buy page.
      Buy page
    5. On the buy page, set Region, Type, Exclusive data integration resources, Units, and Duration as required. Then, click Buy Now.
      In this example, select China (Shanghai) for Region to purchase an exclusive resource group for Data Integration in the China (Shanghai) region. You can select a specification for the exclusive resource group for Data Integration based on your business 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 pane and set the parameters as required.
      Parameter Description
      Resource Group Type The type of the exclusive resource group. In this example, select Exclusive Resource Groups for Data Integration.
      Resource Group Name The name of the exclusive 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 under a tenant.
      Resource Group Description The description of the exclusive resource group.
      Order Number The order number of the exclusive resource group.
    8. Click OK.
  3. Bind the exclusive resource group for Data Integration to the VPC where the ApsaraDB RDS for MySQL instance resides.
    1. On the Exclusive Resource Groups tab, find the exclusive resource group for Data Integration that you created in the Step 2 and click Add VPC Binding in the Actions column.
      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. On the page that appears, click Add Binding in the upper-right corner. In the Add VPC Binding pane, set the parameters as required.
      Add VPC Binding pane
      Parameter Description
      Resource Group Name The name of the resource group to be bound to the VPC. Select the exclusive resource group for Data Integration from the Resource Group Name drop-down list. Check the zone of the exclusive resource group for Data Integration.

      If the exclusive resource group for Data Integration is not in the same zone as the ApsaraDB RDS for MySQL instance, you must perform operations in Step 4 to add a route.

      VPC The VPC to which the exclusive resource group for Data Integration is to be bound. Select the VPC where the ApsaraDB RDS for MySQL instance resides from the VPC drop-down list.
      VSwitch The vSwitch for the selected VPC. Select the vSwitch where the ApsaraDB RDS for MySQL instance resides from the VSwitch drop-down list.
      Security Groups The security group that you want to use to connect to the ApsaraDB RDS for MySQL instance. Select a security group from the Security Groups drop-down list.
    3. Click Create.
  4. Optional:Add a route to connect the exclusive resource group for Data Integration to the ApsaraDB RDS for MySQL instance.
    If the exclusive resource group for Data Integration and the ApsaraDB RDS for MySQL instance are in the same zone, skip this step. If they are in different zones, perform the following steps to add a route:
    1. On the Exclusive Resource Groups tab, find the exclusive resource group for Data Integration that you created in the Step 2 and click Add VPC Binding in the Actions column.
    2. On the page that appears, click Custom Route in the Actions column.
    3. In the Custom Route pane, click Add Route.
    4. In the Add Route dialog box, set the parameters as required.
      Add Route dialog box
      Parameter Description
      Destination Type The network type of the ApsaraDB RDS for MySQL instance. Set the value to VPC.
      Destination VPC The region and VPC where the ApsaraDB RDS for MySQL instance resides.
      Note This parameter appears only when Destination Type is set to VPC.
      Connection Method The method for connecting to the ApsaraDB RDS for MySQL instance. Valid values: Switch, Fixed IP Address, and CIDR Block. Set the value to Switch.
      Destination VSwitch The vSwitch where the ApsaraDB RDS for MySQL instance resides.
      Routing The routing diagram, which 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 that you created in the Step 2 and click View Information in the Actions column.
    2. In the Exclusive Resource Groups dialog box, view the EIP indicated by the EIPAddress parameter.
      EIPAddress
    3. On the Exclusive Resource Groups tab, find the exclusive resource group for Data Integration that you created in the Step 2 and click Add VPC Binding in the Actions column.
    4. On the page that appears, view the ENI IP address in the ENI IP Address column.
      ENI IP Address
    5. Log on to the ApsaraDB for RDS console.
    6. On the Instances page, make sure that the selected region is the region where the ApsaraDB RDS for MySQL instance resides. Find the ApsaraDB RDS for MySQL instance and click Manage in the Actions column. The instance details page appears.
    7. In the left-side navigation pane, click Data Security.
    8. On the Whitelist Settings tab, click Create Whitelist.
    9. In the Create Whitelist dialog box, set the parameters as required and click Add.
      Create Whitelist dialog box
      Parameter Description
      Network Isolation Mode The method for isolating the ApsaraDB RDS for MySQL instance from other cloud resources. You cannot change the value.
      Whitelist Name The name of the whitelist. It 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 The IP addresses that are allowed to access the ApsaraDB RDS for MySQL instance. Add the EIP and ENI IP address of the exclusive resource group for Data Integration to the whitelist.
  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. In the top navigation bar, select the region where the target workspace resides. Find the target workspace and click Data Integration in the Actions column.
    4. On the page that appears, click Connection in the left-side navigation pane. The Data Source page appears.
    5. On the Data Source page, click New data source in the upper-right corner.
    6. In the Add data source dialog box, click MySQL in the Relational Database section.
    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 the value 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.
      Description The description of the connection. The description can be up to 80 characters in length.
      Applicable environment The environment in which the connection is used. Valid values: Development and Production.
      Note This parameter is available 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 purchased the ApsaraDB RDS for MySQL instance. To obtain the ID, perform the following steps: Log on to the DataWorks console. Move the pointer over the profile picture in the upper-right corner and click Security Settings. On the Security Settings page, view the value of the Account ID parameter, which is the ID of your Alibaba Cloud account.
      Database name The name of the database.
      User name The username for logging on to the database.
      Password The password for logging on to the database.
    8. On the Data Integration tab, find the exclusive resource group for Data Integration that you created in Step 2 and click Test connectivity in the Operation column.
    9. After the connection passes the connectivity test, click Complete.