<a id="cc-couchbase-source-eap-gcp"></a>

# Egress Private Service Connect Endpoint Setup: Couchbase on Google Cloud for Confluent Cloud

The Couchbase Source connector for Confluent Cloud supports Google Cloud Private Service
Connect through Egress Private Service Connect Endpoints. Use this guide
to configure the connector and set up the required endpoints.

#### NOTE
After completing the instructions, contact Confluent [Support](https://support.confluent.io/) to
update the `network=external` connector configuration in the backend.

## Prerequisites

The following is a list of prerequisites for configuring the Couchbase DB connector with an Egress Private Service Connect endpoint:

* In Confluent Cloud, one of the following cluster types is 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/gcp.html#ccn-config-gcp).
    The Connection type of the network must be **Private Service Connect**.
  * 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/gcp-egress-privatelink-esku.html#gcp-privatelink-egress-create-gateway-esku).
* Couchbase Capella account with a Google Cloud cluster deployed in a paid account.
* Confluent Cloud network (Dedicated or Serverless Egress Gateway) is set up within the same region and cloud provider as the Couchbase Capella cluster.

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

## Step 1. Create a Couchbase Capella private endpoint

To create a private endpoint for your Dedicated or Enterprise Couchbase database in the Couchbase Capella console, follow these steps:

1. Select the cluster where you want to add a Google Cloud Private Service Connect connection.
2. In the **Networking** section, go to **Settings** > **Private Endpoints**.
3. Click **+ Add Private Endpoint**. Note that if this is the first private endpoint, click **Enable Private Endpoint** first.
   ![Add a Couchbase Capella Private Endpoint](connectors/cc-couchbase-db-source/images-gcp/couchbase-endpoint-service.png)
4. Enter the **VPC ID** and **Subnet ID** of your Couchbase database. This field cannot be left empty. You can add any placeholder text here.
5. Select the confirmation checkbox and click **Next**.
   ![Couchbase Capella Private Endpoint Details](connectors/cc-couchbase-db-source/images-gcp/couchbase-endpoint-create.png)
6. Make a note of the Couchbase **service attachment** names. You will need these to
   create your Confluent Cloud Egress Private Service Connect endpoints.
   * **Service Attachment**: Used for data plane connectivity.
   * **Bootstrap Service**: Used for initial cluster bootstrap.

   ![Couchbase Service Attachment Names](connectors/cc-couchbase-db-source/images-gcp/couchbase-service-names.png)![Couchbase Bootstrap Service Attachment](connectors/cc-couchbase-db-source/images-gcp/couchbase-bootstrap-service.png)
7. Close the workflow. You will complete the rest of the configuration after
   you create a Private Service Connect endpoint in Confluent Cloud.

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

## Step 2. Create Confluent Cloud Egress Private Service Connect endpoints

You must create two Egress Private Service Connect endpoints: one for the
**Service Attachment** and one for the **Bootstrap Service** retrieved in
[Step 1. Create a Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-create-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 Private Service Connect endpoint to.
   The **Connection Type** of the network should be **Private Service Connect**.
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 steps below to specify the following field values:
   * **Service**: Name of service connecting to Couchbase.
   * **Endpoint Name**: Name of the Private Service Connect endpoint.
   * **PrivateLink service name**: The **Service Attachment** URI you
     retrieved in [Step 1. Create a Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-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 endpoint**.
6. Copy the **GCP Project ID** that is generated. You will need this
   in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-configure-endpoint).
   ![GCP Project ID](connectors/cc-couchbase-db-source/images-gcp/create-endpoint-project-id.png)
7. Repeat the steps 2-5 to create a second endpoint for the **Bootstrap Service**
   attachment. Add `_bootstrap` as a suffix in the endpoint name to easily
   differentiate between the two endpoints.

   #### NOTE
   The GCP Project ID is the same for both endpoints. You only need to add
   it to Couchbase Capella once in the next step.

### 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 Private Service Connect endpoint.
3. In the **Access points** tab, click **Add access point**.
4. Click the service you want to connect to, specifically, **Couchbase**. 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 steps below to specify the following field values:
   * **Access point name**: Name of the Private Service Connect 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 **Service Attachment** URI you
     retrieved in [Step 1. Create a Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-create-endpoint).
6. Click **Create access point** to create the Private Service Connect endpoint.
7. Copy the **GCP Project ID** that is generated. You will need this
   in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-configure-endpoint).
8. Repeat the steps 3-6 to create a second access point for the **Bootstrap Service**
   attachment. Add `_bootstrap` as a suffix in the access point name to easily
   differentiate between the two endpoints.

   #### NOTE
   The GCP Project ID is the same for both endpoints. You only need to add
   it to Couchbase Capella once in the next step.

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

## Step 3. Configure the Couchbase Capella private endpoint

To complete the connection, you must authorize the Confluent Cloud  project within the Couchbase Capella console.

1. In the Couchbase Capella console, go to the previously created Couchbase private endpoint screen.
2. In the **Accept the connection** section, enter the **GCP Project ID** retrieved
   from [Step 2. Create Confluent Cloud Egress Private Service Connect endpoints](#cc-couchbase-source-eap-gcp-access-point).
   1. Click **Save & Close**.

   ![Accept Connection with GCP Project ID](connectors/cc-couchbase-db-source/images-gcp/couchbase-accept-connection.png)
3. Make a note of the **Private Endpoint DNS**. You will need this to create DNS records in the next step.
   ![Couchbase Capella Private Endpoint DNS](connectors/cc-couchbase-db-source/images-gcp/couchbase-endpoint-dns.png)

<a id="cc-couchbase-source-eap-gcp-dns-record"></a>

## Step 4. Create DNS records for each endpoint

You must create a DNS record for each of the two Private Service Connect endpoints
created in [Step 2. Create Confluent Cloud Egress Private Service Connect endpoints](#cc-couchbase-source-eap-gcp-access-point).

### Dedicated cluster

1. When the Private Service Connect endpoint status transitions to **Ready**, in the
   **Egress connections** tab, click **Create record** on the associated
   Private Service Connect endpoint.
   ![Create DNS Record](connectors/cc-couchbase-db-source/images-gcp/dns-record-dialogs.png)
2. Specify the following, and click **Save**.
   * **Access point**: Select the Private Service Connect endpoint you created in
     [Step 2. Create Confluent Cloud Egress Private Service Connect endpoints](#cc-couchbase-source-eap-gcp-access-point).
   * **Domain**: Enter the domain name as the Private Endpoint DNS name
     retrieved from Couchbase Capella in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-configure-endpoint).
3. Repeat these steps to create a DNS record for the second (bootstrap)
   endpoint, using the corresponding bootstrap DNS name from Couchbase Capella.

### Enterprise cluster

1. In the **Network Management** tab of your environment, click the
   **For serverless products** tab, and click the Confluent Cloud gateway you
   want to add the DNS record to.
2. In the **DNS** tab, click **Create DNS record**.
3. Specify the following field values:
   * **Access point**: Select the Private Service Connect endpoint you created above in
     [Step 2. Create Confluent Cloud Egress Private Service Connect endpoints](#cc-couchbase-source-eap-gcp-access-point).
   * **Domain**: Enter the domain name as the Private Endpoint DNS name
     retrieved from Couchbase Capella in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-configure-endpoint).
4. Click **Save**.
5. Repeat these steps to create a DNS record for the second (bootstrap)
   endpoint, using the corresponding bootstrap DNS name from Couchbase Capella.

## Step 5. Create the Couchbase Source connector

The final step is to configure the connector using the DNS endpoints you established.

1. Specify the authentication details for Couchbase.

   For the **Couchbase Seed Node**, specify the Private Endpoint DNS name you
   retrieved in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-source-eap-gcp-configure-endpoint) and prepend it with the prefix `couchbases://`
   and append `?network=external` at the end of the connection string
   (for example, `couchbases://<private-endpoint-dns>?network=external`).
   ![Create Couchbase DB Source Connector](connectors/cc-couchbase-db-source/images-gcp/connector-connection-config.png)
2. Follow the steps to create the [source connector](cc-couchbase-db-source.md#cc-couchbase-source-setup-connection) in Confluent Cloud.
3. After the connector is provisioned, contact Confluent [Support](https://support.confluent.io/) and provide the
   **Connector Unique ID** to enable the `network=external` parameter in the backend.
   The connector begins processing data once this backend configuration is complete.
