> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PrivateLink setup for MySQL in ELT & CDC

> Set up AWS PrivateLink for your MySQL database connection in Integrate.io ELT & CDC. Establish a secure private network link for replication.

## **How to setup your MySQL database using Privatelink**

### Please follow these instructions to set up Privatelink for your private MySQL data source

<Steps>
  <Step>
    Create a Target group for the Network Load Balancer that you will create in the next step. Pick ‘IP addresses’ in the configuration page and give the target group a name. Choose the VPC that your DB is in.

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-1.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=5473a86d98e4d211c13dcc416b30fb45" alt="AWS target group creation with IP addresses type selected" width="1200" height="1033" data-path="images/cdc/security/image-1.png" />
    </Frame>

    <br />

    <br />

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-2.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=5b51484373d1ee85e332609fb8a18bd3" alt="Target group name and VPC selection for the MySQL database" width="1200" height="584" data-path="images/cdc/security/image-2.png" />
    </Frame>

    On the next page, specify the IP of the MySQL RDS and include it as pending. You can use the dig +short YOUR\_RDS\_DNS\_ENDPOINT command to get the IP of the RDS instance. Do note that the IP address can change without notice. You can use this guide to create a lambda to periodically check the IP and update the target group - [https://aws.amazon.com/blogs/networking-and-content-delivery/hostname-as-target-for-network-load-balancers/](https://aws.amazon.com/blogs/networking-and-content-delivery/hostname-as-target-for-network-load-balancers/) 

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-3.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=bf4f9315dce1ffc2f9aa5dd34dea893d" alt="Registering the MySQL RDS IP address as a pending target" width="1200" height="638" data-path="images/cdc/security/image-3.png" />
    </Frame>
  </Step>

  <Step>
    In your VPC, create a Network Load Balancer and configure it for each subnet (AZ) in which the service should be available. Make sure that ‘Internal’ is selected for the scheme field.

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-4.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=9acbcc9f98a70ad72b6db34f06550210" alt="Network Load Balancer creation with Internal scheme selected" width="1200" height="608" data-path="images/cdc/security/image-4.png" />
    </Frame>

    Make sure that the VPC selected is the same as the MySQL database and pick the appropriate AZs. Also, select the target group you created in the step above and update the port to the MySQL port.

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-5.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=d420bccab88be66cd9ce32e6a0bca499" alt="VPC and availability zone selection for the Network Load Balancer" width="1200" height="743" data-path="images/cdc/security/image-5.png" />
    </Frame>

    <br />

    <br />

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-6.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=c0228fb03c9891053d1cf9e5410c1121" alt="Listener configuration with target group and MySQL port" width="1200" height="583" data-path="images/cdc/security/image-6.png" />
    </Frame>
  </Step>

  <Step>
    Next, create a VPC endpoint service configuration. Give it an appropriate name and select the NLB created above in the available load balancers list. Choose the other settings as specified in the image below.

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-7.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=26f8434f23ca280c85e61f3d1d07ca2e" alt="VPC endpoint service configuration with NLB selected" width="1200" height="710" data-path="images/cdc/security/image-7.png" />
    </Frame>

    <br />

    <br />

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-8.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=e3032387e1ff1feb66424e5995a02cbd" alt="Endpoint service additional settings" width="1200" height="371" data-path="images/cdc/security/image-8.png" />
    </Frame>
  </Step>

  <Step>
    Add our AWS Account ID to allow access to your VPC (arn:aws:iam::231173364718:user/privatelink). Send the service name of your VPC endpoint service to us, so that we can set up the connection at our end.

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-9.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=4ad927c0c431f5c52b70dd57d2467a6b" alt="Adding the Integrate.io AWS Account ID to the allowed principals" width="1200" height="304" data-path="images/cdc/security/image-9.png" />
    </Frame>
  </Step>

  <Step>
    Accept the interface endpoint connection request from us after our setup is complete.

    <Frame>
      <img src="https://mintcdn.com/integrateio/MGWLTifrhXADDsEf/images/cdc/security/image-10.png?fit=max&auto=format&n=MGWLTifrhXADDsEf&q=85&s=9ff779d2a2ecc4fb0a0e8ba8522bb24a" alt="Accepting the VPC endpoint connection request" width="1200" height="215" data-path="images/cdc/security/image-10.png" />
    </Frame>
  </Step>

  <Step>
    We will also provide you the DNS name of the VPC endpoint at our end that you can use in the Source connection settings to set up your source. In case you see a connection timeout after adding the details, please run a FLUSH HOSTS on the mysql database.
  </Step>
</Steps>
