> For the complete documentation index, see [llms.txt](https://docs.koinju.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.koinju.io/sql-api-specifics/private-link-setup.md).

# 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%2Fgit-blob-46092e44d569300768ff990011a8ef3415509b94%2Fimage.png?alt=media" 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.

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%2Fgit-blob-c557d06572055d6fe482a79d31450b5ef5c0503c%2Fimage.png?alt=media" 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%2Fgit-blob-cbf67fc3a45b3a12427df8916c249338f1b67546%2Fimage.png?alt=media)

## 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.

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