# 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="/files/kkohfkGRi5UFzfsCiKVE" 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="/files/Wyuy4gEqZIaHhxYRTFfz" 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.\
![](/files/dPWh7HBos7GFMmms0wCZ)

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.koinju.io/sql-api-specifics/private-link-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
