<a id="cc-snowflake-source-eap-aws"></a>

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

The Snowflake Source 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 Snowflake Source
connector with an Egress PrivateLink Endpoint:

* A Confluent Cloud Dedicated cluster was set up and is running within an AWS
  PrivateLink network.
* Snowflake instance was created to source data from and is running within the
  same region and cloud as the Confluent Cloud cluster. A `Snowflake Business Critical
  Account` configured for the connector access.
* A database and a schema were created in Snowflake to source data from.
* Snowflake imposes restrictions on which DNS hostnames can be used to connect.
  Be sure to use the hostnames mentioned in [AWS PrivateLink and Snowflake](https://docs.snowflake.com/en/user-guide/admin-security-privatelink#specify-hostname-for-snowflake-clients).

#### NOTE
For added security, you can set up a Network rule within Snowflake to
[restrict incoming traffic](https://docs.snowflake.com/en/user-guide/network-rules#incoming-requests)
to the specific VPC Endpoint setup as part of Egress PrivateLink Endpoints.

## Step 1. Create a gateway in Confluent Cloud (for Enterprise cluster only)

If using an Enterprise cluster in Confluent Cloud, you must set up a gateway in
Confluent Cloud as described in [Create a gateway for outbound connectivity in Confluent Cloud](../../networking/aws-egress-privatelink-esku.md#aws-privatelink-egress-create-gateway-esku).

## Step 2. Request Snowflake to allowlist Confluent’s AWS account

1. In the Confluent Cloud Console, go to **Environment** → **Network**, and select
   the associated Privatelink network you want to use.
2. In the **Egress PrivateLink Endpoints** tab, make note of Confluent’s AWS Account
   ID associated with the PrivateLink Endpoint.
   ![image](connectors/cc-snowflake-source/images-aws/aws-account-id.png)
3. Wait to receive confirmation from Snowflake that Confluent’s AWS Account
   ID has been allowlisted before proceeding.

## Step 3. Obtain the Snowflake Private Link Service ID

To obtain the Service ID associated with your Snowflake instance, execute the
following statement from within your Snowflake account and make note of the
value of `privatelink-vpce-id`:

```SQL
USE ROLE ACCOUNTADMIN;

SELECT KEY, VALUE::VARCHAR VPCE_SERVICE_ID

FROM TABLE(FLATTEN(INPUT=>PARSE_JSON(SYSTEM$GET_PRIVATELINK_CONFIG())))
WHERE KEY = 'privatelink-vpce-id';
```

<br/>
![image](connectors/cc-snowflake-source/images-aws/vpce-id.png)

## Step 4. Create an Egress PrivateLink Endpoint

1. In the **Network Management** 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, **Snowflake**.
4. Follow the guided steps to specify the field values, including:
   * **Name**: Name of the PrivateLink Endpoint.
   * **PrivateLink service name**: The name of the PrivateLink service you
     retrieved in [Obtain AWS PrivateLink Service name](../../networking/aws-egress-privatelink.md#aws-privatelink-egress-obtain-service-name).
   * **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**.

## Step 5. Create a DNS record

1. When the PrivateLink Endpoint status transitions to “Ready”, in the **DNS** tab,
   click **Create record** on the associated PrivateLink Endpoint.
   ![image](connectors/cc-snowflake-source/images-aws/create-dns-record.png)
2. Specify the following, and click **Save**.
   * **Endpoint**: Select the PrivateLink Endpoint you created above.
   * **Domain**: `privatelink.snowflakecomputing.com`

   ![image](connectors/cc-snowflake-source/images-aws/dns-record.png)

## Step 6. Create the Snowflake Source connector

1. Specify the authentication details for Snowflake.

   For the Connection URL, specify Snowflake’s private endpoint URL
   (`https://<org_name>-<account_name>.privatelink.snowflakecomputing.com`).
   ![image](connectors/cc-snowflake-source/images-aws/add-snowflake-source-connector.png)
2. Follow the steps to create the [source connector](cc-snowflake-source.md#cc-snowflake-source) in
   Confluent Cloud.
