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

# Setting Up Amazon Redshift as a Data Source

> Connect Amazon Redshift to GrowthBook with a read-only user, security group access for the Cloud IP, and connection details.

Connecting Amazon Redshift to GrowthBook allows you to analyze experiment data and metrics directly from your data warehouse.

<Note>
  **This guide focuses on Redshift Serverless, but the steps are similar for provisioned Redshift instances.**
</Note>

## 1: Find Connection Details

1. In the **AWS Management Console**, navigate to **Amazon Redshift** → **Serverless**.
2. Click on **Workgroup configuration**, select your workgroup.
3. Under **General information**, locate the **Endpoint**, which looks like this:

`default-workgroup.1234567890.us-east-1.redshift-serverless.amazonaws.com:5439/dev`

This string comprises the following parts:

* Host: `default-workgroup.1234567890.us-east-1.redshift-serverless.amazonaws.com`
* Port: `5439`
* Database Name: `dev`

<Frame>
  <img src="https://mintcdn.com/growthbook-ea15456d/4KUzUtpaNUGa50Xc/static/images/guides/redshift-details.png?fit=max&auto=format&n=4KUzUtpaNUGa50Xc&q=85&s=82bef8b00d205929bf33fb2ce29bf929" alt="Redshift details" width="800" data-path="static/images/guides/redshift-details.png" />
</Frame>

## 2: Configure Security settings

1. Go to **AWS Console** → **Amazon Redshift** → **Serverless** → **Workgroups**.
2. Click on your Workgroup and scroll to **Network and Security**.
3. Click **Edit** and check **Turn on Publicly accessible**.
   <Frame>
     <img src="https://mintcdn.com/growthbook-ea15456d/4KUzUtpaNUGa50Xc/static/images/guides/redshift-publicy-accessible.png?fit=max&auto=format&n=4KUzUtpaNUGa50Xc&q=85&s=57f4408f5a4d73b694b209c3fccc9c24" alt="Redshift Publicly Accessible" width="2140" height="1368" data-path="static/images/guides/redshift-publicy-accessible.png" />
   </Frame>
4. Click **Save Changes**.
5. Click on the **VPC security group** link.
6. Select the Security Group matching your Workgroup.
7. Edit **Inbound Rules**:
   * Protocol: TCP
   * Port: 5439
   * Source: 52.70.79.40/32 (GrowthBook’s IP)
8. Click **Save Changes**.

<Frame>
  <img src="https://mintcdn.com/growthbook-ea15456d/4KUzUtpaNUGa50Xc/static/images/guides/redshift-inbound-rules.png?fit=max&auto=format&n=4KUzUtpaNUGa50Xc&q=85&s=353d874ee71a103746cbfeebc9c7bb7c" alt="Redshift Inbound Rules" width="800" data-path="static/images/guides/redshift-inbound-rules.png" />
</Frame>

<Warning>
  **Enabling public access makes your database accessible from the internet.**

  Ensure your security group settings are restrictive.
</Warning>

## 3: Create a Read-Only User

To prevent unauthorized changes, use a dedicated read-only user for GrowthBook.

1. Open AWS Query Editor or your preferred SQL client.
2. Run the following:

```sql theme={null}
CREATE USER growthbook_user WITH PASSWORD 'securepassword';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO growthbook_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO growthbook_user;
```

<Tip>
  **If your data is in a different schema (e.g., analytics), replace public with your schema name.**
</Tip>

3. Use this user when connecting GrowthBook.

## 4: Add Redshift as a Data Source in GrowthBook

1. In GrowthBook, go to **Settings** → **Data Sources.**

2. **Click Add Data Source** and choose **Redshift**.

3. Enter the details from Step 1:
   * Host: (Your Workgroup Endpoint for Serverless or Cluster Endpoint for Provisioned)
   * Port: `5439`
   * Database: (Your database name, e.g., `dev`)
   * User: `growthbook_user`
   * Password: (Your secure password)
   * Require SSL: Recommended but may depend on your Redshift setup.

4. Click **Next** to test the connection.

<Frame>
  <img src="https://mintcdn.com/growthbook-ea15456d/4KUzUtpaNUGa50Xc/static/images/guides/redshift-connection-in-gb.png?fit=max&auto=format&n=4KUzUtpaNUGa50Xc&q=85&s=53287c60403294f77d4f05fd6344f670" alt="Redshift GrowthBook connection" width="1465" height="1169" data-path="static/images/guides/redshift-connection-in-gb.png" />
</Frame>

🚀 Now, GrowthBook can securely query your Redshift database!
