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

# Redshift

> Connect Amazon Redshift to Paradime to run dbt™ from the Code IDE, deploy production jobs with Bolt, and let DinoAI background agents query your cluster.

[Amazon Redshift](https://aws.amazon.com/redshift/) is a cloud data warehouse for storing and querying your data. Connect it to Paradime to run dbt™ from the Code IDE, deploy production jobs with Bolt, and let the DinoAI background agent work against your warehouse.

<Warning>
  **IP restrictions**

  Allow traffic from one of the Paradime IPs in your firewall, depending on the data location selected.

  See also: [Paradime IP addresses](/developers/ip-restrictions).
</Warning>

## Connection environments

Paradime connects to Redshift separately for each environment. You configure one connection per environment in **Workspace Settings > Environments**.

| Environment | Used by                                        | Typical target | Authentication methods     |
| ----------- | ---------------------------------------------- | -------------- | -------------------------- |
| Code IDE    | Running dbt™ from the terminal in the Code IDE | `dev`          | Username and password, IAM |
| Bolt        | Production jobs run by Bolt                    | `prod`         | Username and password      |
| Agent       | Background agent sessions                      | `dinoai`       | Username and password      |

The connection fields are the same across environments. What differs is the **Redshift permissions** you grant: the Code IDE connection typically reuses a developer's access, while the Bolt and Agent environments should each use a dedicated service user with the minimum permissions required.

## Suggested permissions

<Tabs>
  <Tab title="Bolt">
    We recommend creating a new Redshift user and granting the suggested access required to create tables and views in your production database. Run the script below in Redshift as an `Account Admin`. This set of permissions lets Paradime read from and create tables and views when running production jobs in your Redshift database.

    ```sql theme={"system"}
    -- create group
    create group transformer;

    -- create user and assign to group
    create user paradime_prod_user
        password '<generate_password>'
        in group transformer;

    -- grant privileges to the user group
    grant select on all tables in schema information_schema to group transformer;
    grant select on all tables in schema pg_catalog to group transformer;

    -- for each schema:
    grant usage on schema <schema_name> to group transformer;
    grant select on all tables in schema <schema_name> to group transformer;

    -- grant privileges to user group to create in database
    grant create on database <your_database> to group transformer;
    ```

    In Redshift, after each dbt™ run in production you need to make sure the correct privileges are granted, as Redshift does not support grant on future schemas. The `paradime_prod_user` should be able to read new schemas created in your production runs. Check [this](https://docs.getdbt.com/blog/configuring-grants) guide on using grants and hooks.
  </Tab>

  <Tab title="Agent">
    We recommend creating a dedicated Redshift service user for the Agent environment, with the minimum permissions required to create tables and views in your database. Run the script below in Redshift as an `Account Admin`. This set of permissions lets DinoAI read from and create tables and views during background agent sessions in your Redshift database.

    ```sql theme={"system"}
    -- create group
    create group transformer;

    -- create user and assign to group
    create user paradime_dinoai_user
        password '<generate_password>'
        in group transformer;

    -- grant privileges to the user group
    grant select on all tables in schema information_schema to group transformer;
    grant select on all tables in schema pg_catalog to group transformer;

    -- for each schema:
    grant usage on schema <schema_name> to group transformer;
    grant select on all tables in schema <schema_name> to group transformer;

    -- grant privileges to user group to create in database
    grant create on database <your_database> to group transformer;
    ```

    In Redshift, after each DinoAI background agent session you need to ensure the correct privileges are granted, as Redshift does not support grant on future schemas. The `paradime_dinoai_user` should be able to read new schemas created during agent sessions. Check [this](https://docs.getdbt.com/blog/configuring-grants) guide on using grants and hooks.
  </Tab>
</Tabs>

## Add a connection

1. Click **Settings** in the top menu bar of the Paradime interface to access **Workspace Settings**.
2. In the left sidebar, click **Environments**.
3. Click **Add New** next to the section for the environment you are configuring:
   * **Code IDE** for the Code IDE connection
   * **Bolt** for the Bolt connection
   * **Agent** for the Agent connection
4. Select **Redshift** and choose an authentication method.

## Authentication methods

<CardGroup cols={2}>
  <Card title="Username and password" href="/integrations/redshift/username-and-password" icon="key">
    Connect with a Redshift username and password. Available in all environments.
  </Card>

  <Card title="IAM" href="/integrations/redshift/iam" icon="shield-check">
    Connect using an IAM profile configuration. Code IDE only.
  </Card>
</CardGroup>

## Related

<CardGroup cols={2}>
  <Card title="Optional connection attributes" href="/guides/data-warehouse-essentials/optional-connection-attributes" icon="gear" horizontal>
    Set additional `profiles.yml` attributes for this connection.
  </Card>

  <Card title="AWS PrivateLink" href="/integrations/aws-privatelink/redshift-privatelink" icon="aws" horizontal>
    Connect privately over an AWS VPC endpoint.
  </Card>
</CardGroup>


## Related topics

- [Redshift](/integrations/redshift/index.md)
- [Redshift Tools](/products/dino-ai/tools-and-features/warehouse-tool/redshift-tools.md)
- [Redshift PrivateLink](/integrations/aws-privatelink/redshift-privatelink.md)
- [Username and password](/integrations/redshift/username-and-password.md)
- [IAM](/integrations/redshift/iam.md)
