> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/context/knowledge-bases/add-data/import-from-sql-database/data-sources/redshift.md).

# Redshift

Connect to a Redshift database in AirOps

{% hint style="info" %}
**Remember to allowlist our IP Address `52.71.87.39`**

If your database is protected by a firewall, remember to allow inbound access to AirOPs IP address over your database port.
{% endhint %}

1. **Host or IP** - The endpoint of your AWS Redshift cluster.\
   Example: `examplecluster.abcdefghijkl.us-west-2.redshift.amazonaws.com`
2. **Port** - The port on which your Redshift cluster is listening. Default is `5439`.
3. **User** - The Redshift user that AirOps will connect to the database with. It is best practice to create a new user for AirOps (instructions below), but any user with SELECT privileges can be used.
4. **Password** - Password for the above user.
5. **Database** - The Redshift database that AirOps will connect to.

<figure><img src="https://3762890407-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX2n5yPRPynbnWuO4SH0M%2Fuploads%2Fgit-blob-21ac5467827d81e59b237c2555bc0359fb913dc8%2Fredshift-01-form.png?alt=media" alt="Redshift connection form with host, port, user, password, and database fields and a Connect button"><figcaption><p>Enter the Redshift connection details.</p></figcaption></figure>

## Setup User and Grant Access (for New Users)

To add an AWS Redshift database as a Data Source on AirOps, use an existing user or create a user with **read** access to the tables and schemas you would like to access from AirOps:

### 1. Create AirOps User

```sql
CREATE USER airops_user
PASSWORD '<secure-password>';
```

### 2. Grant USAGE and SELECT privileges to AirOps user

Replace `<schema>` and `<table>` with the appropriate schema and table names that you would like AirOps to interact with.

```sql
GRANT USAGE ON SCHEMA "<schema>" TO airops_user;

GRANT SELECT ON TABLE "<schema>"."<table>" TO airops_user;
```

If you want to grant access to multiple tables, you can run the `GRANT SELECT` statement for each table.

### 3. (Optional) Grant access to future tables in the schema

If you want to grant access to all future tables in a schema, you can use the following command. Replace with the appropriate schema name.

```sql
ALTER DEFAULT PRIVILEGES IN SCHEMA "<schema>"
GRANT SELECT ON TABLES TO airops_user;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.airops.com/context/knowledge-bases/add-data/import-from-sql-database/data-sources/redshift.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
