# Redshift

{% hint style="warning" %}
**IP RESTRICTIONS**

Make sure to allow traffic from one of the Paradime IPs in your firewall depending on the data location selected.

👉 See also: [Paradime IP addresses](https://docs.paradime.io/app-help/developers/ip-restrictions).
{% endhint %}

{% hint style="info" %}
We recommend creating a dedicated Redshift service user for the DinoAI agent environment, with the minimum permissions required to create tables and views in your database.
{% endhint %}

### Create a Redshift user

Run the script below in Redshift to create a dedicated service user for the DinoAI agent environment. Make sure you run these commands as an **`Account Admin`**.

#### Suggested permissions

This set of permissions will enable DinoAI to read from and create tables and views during background agent sessions in your Redshift database.

{% code lineNumbers="true" %}

```sql
-- 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;
```

{% endcode %}

#### Maintain privileges

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.

{% hint style="info" %}
Check [this](https://docs.getdbt.com/blog/configuring-grants) guide on using grants and hooks.
{% endhint %}

### Add the DinoAI agent environment connection

1. Click **Settings** in the top menu bar of the Paradime interface to access **Account Settings**
2. In the left sidebar, click **Connections**
3. Click **Add New** next to the **DinoAI Background Agent Environment** section
4. Select **Redshift** and fill out the corresponding fields.

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FFFtIIbODqFvP27j0mlaN%2Fprod_connection_redshift_u%26p.png?alt=media&#x26;token=aad77cdd-001c-4381-8842-dfbfd757cc67" alt="" width="540"><figcaption></figcaption></figure>

#### Field details

| Field        | Description                                                                                                                                              | Example                           |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| Profile Name | The profile name set in your `dbt_project.yaml`. See more [here](https://docs.getdbt.com/docs/core/connect-data-platform/connection-profiles).           | **`dbt-redshift`**                |
| Target       | The target name used to identify the DinoAI agent environment connection. See more [here](https://docs.getdbt.com/reference/dbt-jinja-functions/target). | **`dinoai`**                      |
| Host Name    | The hostname of the Redshift database to connect to.                                                                                                     | **`xxx.eu-west-2.amazonaws.com`** |
| Port         | Usually `5439` for Redshift.                                                                                                                             | **`5439`**                        |
| Database     | The name of the Redshift database the DinoAI agent will query and build objects in.                                                                      | **`analytics`**                   |
| Username     | The DinoAI agent service user created with access to the database.                                                                                       | **`paradime_dinoai_user`**        |
| Password     | The password set for the DinoAI agent service user.                                                                                                      | **`password_xyz`**                |
| Schema       | The default schema used to build dbt™ objects during DinoAI background agent sessions.                                                                   | **`dbt_dinoai`**                  |
| Threads      | The number of threads used in this connection. See more [here](https://docs.getdbt.com/docs/running-a-dbt-project/using-threads).                        | **`8`**                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paradime.io/app-help/documentation/settings/connections/dinoai-background-agent-environment/redshift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
