# Private Link Setup

For advanced clients wishing consuming data from services hosted on AWS we provide the possibility to connect to our database through AWS Private Link.

## 1) Request the Service name and DNS name from Koinju

## 2) Create AWS Endpoint

**AWS console**

Open the AWS console and Go to **VPC** → **Endpoints** → **Create endpoints**.

Select **Endpoint services that use NLBs and GWLBs** and use `Service name` or `endpointServiceId` you got from [Obtain Endpoint "Service name" ](https://clickhouse.com/docs/manage/security/aws-privatelink#obtain-endpoint-service-info)step in **Service Name** field. Click **Verify service**:

<figure><img src="https://1444164937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh5glMHHpbWv5M7q20iNo%2Fuploads%2FVcczDRhANci6vdEJlu9Y%2Fimage.png?alt=media&#x26;token=6c829a29-3658-4d14-81d3-3a3e485ce1fe" alt=""><figcaption></figcaption></figure>

If you want to establish a cross-regional connection via PrivateLink, enable the "Cross region endpoint" checkbox and specify the service region as `eu-central-1`.

If you get a "Service name could not be verified." error, please contact Koinju team.&#x20;

Next, select your VPC and subnets:

<figure><img src="https://1444164937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh5glMHHpbWv5M7q20iNo%2Fuploads%2FK8IHh6uEC1CKMT2WjeuW%2Fimage.png?alt=media&#x26;token=650355d0-298f-4741-b01f-c64a6c101e1e" alt=""><figcaption></figcaption></figure>

> Make sure that `Enable DNS Name` is selected

As an optional step, assign Security groups/Tags:

> Make sure that ports `443`, `8443`, `9440`, `3306` are allowed in the security group.

After creating the VPC Endpoint, communicate the  `Endpoint ID` to the Koinju team that will connect it to the clickhouse instance. \
![](https://1444164937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh5glMHHpbWv5M7q20iNo%2Fuploads%2FmCfYZROREafHqoKUoal6%2Fimage.png?alt=media\&token=8824d37e-48c8-4c37-af7b-c1e3850fd50e)

## 3) Test Connection

Once green-lit by the Koinju team you will be able to connect to the clickhouse instance via the DNS name provided to you in step 1 from within your VPC.&#x20;

> More information about the private link setup : <https://clickhouse.com/docs/manage/security/aws-privatelink>
