<!-- WARNING: THIS IS A SHARED FILE AND THE SOURCE IS LOCATED IN DOCS-COMMON. DO NOT ADD TO ANY OTHER REPO. -->

<a id="cc-couchbase-eap-aws"></a>

# Egress PrivateLink Endpoint Setup: Couchbase on AWS for Confluent Cloud

The Couchbase Sink connector for Confluent Cloud supports AWS PrivateLink
connectivity through Egress PrivateLink Endpoints. Use this guide to
configure the connector and set up the required endpoints.

## Prerequisites

The following is a list of prerequisites for configuring the Couchbase DB connector with an Egress PrivateLink Endpoint:

* In Confluent Cloud, one of the following cluster types was set up with the specified
  network resource:
  * A Dedicated cluster with a Confluent Cloud network

    For the steps to create a Confluent Cloud network, see [Create a Confluent Cloud network](/cloud/current/networking/ccloud-network/aws.html#ccn-config-aws).
    The Connection type of the network needs to be “PrivateLink Access”.
  * A Enterprise cluster with a network gateway

    For the steps to create a gateway, see
    [Create a gateway for outbound connectivity in Confluent Cloud](/cloud/current/networking/aws-egress-privatelink-esku.html#aws-privatelink-egress-create-gateway-esku).
* Couchbase Capella DB running in AWS cloud.
* Confluent Cloud network (Dedicated or Serverless Egress Gateway) setup within same region and cloud as Couchbase Capella DB.

<a id="cc-couchbase-eap-aws-create-endpoint"></a>

## Step 1. Create a Couchbase Capella private endpoint

In the Couchbase Capella console, create a private endpoint for your Dedicated or Enterprise
Couchbase database:

1. Select a cluster to add an AWS PrivateLink connection.
2. In the **Networking** section, go to **Settings** → **Private Endpoints**.
3. Click **+ Add Private Endpoint**. Note that if this is the first time setting up a private endpoint,
   you will first need to enable it by clicking **Enable Private Endpoint**.
   ![Add a Couchbase Capella Private Endpoint](connectors/cc-couchbase-db-sink/images-aws/couchbase-endpoint-service.png)
4. Specify the **VPC ID** and **Subnet ID** of your Couchbase database (cannot be
   left empty, add any placeholder text here). Check the confirmation box, and
   then click **Next**.
   ![Couchbase Capella Private Endpoint Details](connectors/cc-couchbase-db-sink/images-aws/couchbase-endpoint-create.png)
5. Make a note of the **Couchbase service name** which will be required for
   creating a Confluent Cloud Egress PrivateLink Endpoint.
   ![Couchbase Service Name](connectors/cc-couchbase-db-sink/images-aws/couchbase-service-name.png)
6. You can close the workflow for now. You will complete the rest of the configuration after
   you create a VPC endpoint ID in Confluent Cloud.

<a id="cc-couchbase-eap-aws-access-point"></a>

## Step 2. Create a Confluent Cloud Egress PrivateLink Endpoint

### Dedicated cluster

1. In the **Network management** page or tab of the desired Confluent Cloud environment,
   click the Confluent Cloud network you want to add the PrivateLink Endpoint to.
   The **Connection Type** of the network needs to be “PrivateLink
   Access”.
2. Click **Create endpoint** in the **Egress connections**
   tab.
3. Click the service you want to connect to, specifically, **Couchbase**. Select **Other** if you do not see the specific service.
4. Follow the guided steps to specify the field values, including:
   * **Service**: Name of the service connecting to. For example, Couchbase.
   * **Endpoint Name**: Name of the PrivateLink Endpoint.
   * **PrivateLink service name**: The name of the PrivateLink service you
     retrieved in [Step 1. Create a Couchbase Capella private endpoint](#cc-couchbase-eap-aws-create-endpoint).
   * **Create an endpoint with high availability**: Check the box if
     you wish to deploy an endpoint with High Availability.

     Endpoints deployed with high availability have network interfaces
     deployed in multiple availability zones.
5. Click **Create** to create the PrivateLink Endpoint.
6. If there are additional steps for the specific target service, follow
   the prompt to complete the tasks, and then click **Finish**.

### Enterprise cluster

1. In the **Network management** page or tab of the desired Confluent Cloud environment,
   click the **For serverless products** tab.
2. Click the gateway to which you want to add the PrivateLink Endpoint.
3. In the **Access points** tab, click **Add access point**.
4. Click the service you want to connect to. Select **Other** if you do
   not see the specific service.

   Specific services are listed based on the cloud provider for the
   gateway.
5. Follow the guided steps to specify the field values, including:
   * **Access point name**: Name of the PrivateLink Endpoint.
   * **Create an endpoint with high availability**: Check the box if
     you wish to deploy an endpoint with High Availability.

     Endpoints deployed with high availability have network interfaces
     deployed in multiple availability zones.
   * **PrivateLink service name**: The name of the PrivateLink service you
     retrieved in [Step 1. Create a Couchbase Capella private endpoint](#cc-couchbase-eap-aws-create-endpoint).
6. Click **Create access point** to create the PrivateLink Endpoint.
7. If there are additional steps for the specific target service, follow
   the prompt to complete the tasks, and click **Finish**.

<a id="cc-couchbase-eap-aws-configure-endpoint"></a>

## Step 3. Configure the Couchbase Capella private endpoint

1. In the Couchbase Capella console, go to previously created Couchbase private endpoint screen.
2. Click **Accept** to complete the AWS PrivateLink connection setup.
   ![Configure Couchbase Capella Private Endpoint](connectors/cc-couchbase-db-sink/images-aws/couchbase-endpoint-accept.png)
3. Make a note of the Private Endpoint DNS which will be required for
   creating a DNS record in the next step.
   ![Copy Couchbase Capella Private Endpoint](connectors/cc-couchbase-db-sink/images-aws/couchbase-endpoint-copy.png)

## Step 4. Create a DNS record

1. In the Couchbase Capella console, when the PrivateLink Endpoint status transitions to “Ready”,
   click **Create record** on the associated PrivateLink Endpoint.
   ![Create DNS record](connectors/cc-couchbase-db-sink/images-aws/dns-record.png)
2. Specify the following, and click **Save**.
   * **Access point**: Select the PrivateLink Endpoint you created above in
     [Step 2. Create a Confluent Cloud Egress PrivateLink Endpoint](#cc-couchbase-eap-aws-access-point).
   * **Domain**: Enter the domain name you created above in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-eap-aws-configure-endpoint).

## Step 5. Create the Couchbase Sink connector

1. Specify the authentication details for Couchbase.

   For the **Couchbase Seed Node**, specify the DNS name you created above
   in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-eap-aws-configure-endpoint) and prepend it with the prefix `couchbases://`
   (for example, `couchbases://<private-endpoint-dns>`).
   ![Create Couchbase DB Sink Connector](connectors/cc-couchbase-db-sink/images-aws/add-couchbase-sink-connector.png)
2. Follow the steps to create the [sink connector](cc-couchbase-db-sink.md#cc-couchbase-sink-setup-connection) in Confluent Cloud.
