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

**1. Find endpoint details**

1. In the Redshift console, click **Clusters**.
2. Select the cluster you would like to connect.

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

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.

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

**2. 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.

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

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**.

**3. 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>;
```

> [!NOTE]
>
> **Additional permissions required for source queries**
>
> If any of your Prequel models currently use or will use [source queries](https://docs.prequel.co/export/features/custom-queries.md), Prequel creates a temporary view in the source schema during each transfer and drops it afterwards. You will need to also provide the `CREATE` privilege on the source schema to the Redshift user.
>
> ```sql title="Grant source query privileges" icon="database" theme={null}
> GRANT CREATE ON SCHEMA <schema> TO <username>;
> ```

**4. Add source to Prequel**

Use the UI or a [cURL request](https://docs.prequel.co/export/api-reference/overview.md) 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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.