> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prequel.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Redshift

> Instructions for connecting to a Redshift data warehouse as a source

<Steps>
  <Step title="Find endpoint details">
    1. In the Redshift console, click **Clusters**.
    2. Select the cluster you would like to connect.

    <Frame>
      ![](https://storage.googleapis.com/prequel_docs/images/redshift-cluster.png "redshift cluster.png")
    </Frame>

    3. In the **General information** pane, make note of the **Endpoint** details. You may need to use the **copy** icon to copy the full details to discover the full endpoint and port number.

    <Frame>
      ![](https://storage.googleapis.com/prequel_docs/images/redshift-endpoint-details.png "redshift endpoint details.png")
    </Frame>
  </Step>

  <Step title="Allow Prequel to connect">
    1. In the Redshift console, click **Clusters**.
    2. Select the cluster you would like to connect.
    3. Click the **Properties** tab.
    4. Scroll down to the **Network and security settings** section.
    5. In the VPC security group field, select a security group to open it.

    <Frame>
      ![](https://storage.googleapis.com/prequel_docs/images/redshift-vpc-security-groups.png "redshift vpc s groups.png")
    </Frame>

    6. In the Security Groups window, click **Inbound rules**.
    7. Click **Edit inbound rules**.
    8. In the Edit the Inbound rules window, follow the steps below to create custom TCP rules for Prequel's IP:
       a. Select **Custom TCP** in the drop-down menu.
       b. Enter your Redshift port number. (likely `5439`)
       c. Enter the Prequel static IP address.
       d. Click **Add rule**.
  </Step>

  <Step title="Create a Limited User">
    1. Connect to Redshift using the SQL client.
    2. Execute the following query to create a user (replace `<password>` with a password of your choice).

    ```sql title="Create user" icon="database" theme={null}
    CREATE USER <username> PASSWORD '<password>';
    ```

    3. Execute the following query to grant the prequel user read-only privileges (replace `<database>` with your database name):

    ```sql title="Grant read-only access" icon="database" theme={null}
    GRANT USAGE ON SCHEMA <schema> TO <username>;
    GRANT SELECT ON ALL TABLES IN SCHEMA <schema> TO <username>;
    ```
  </Step>

  <Step title="Add source to Prequel">
    Use the UI or a [cURL request](/export/api-reference/overview) to add the configured source to Prequel.

    1. The **name** is a descriptive name of the source for your purposes (i.e., a description)
    2. The  **host** \[for example,`source-redshift.cw1drqwgbdue.us-east-1.redshift.amazonaws.com`]
    3. The **port** \[most likely `5439`]
    4. The **vendor**: `redshift`
    5. The **database** from which tables will be read
    6. The **username** from Step 3
    7. The **password** from Step 3
  </Step>
</Steps>
