> 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/docs/es/contexto/memory-stores/add-data/import-from-sql-database/data-sources/redshift.md).

# Redshift

Conéctate a una base de datos Redshift en AirOps

{% hint style="info" %}
**Recuerda permitir nuestra dirección IP en la lista permitida `52.71.87.39`**

Si tu base de datos está protegida por un firewall, recuerda permitir el acceso entrante a la dirección IP de AirOps a través del puerto de tu base de datos.
{% endhint %}

1. **Host o IP** - El endpoint de tu clúster de AWS Redshift.\
   Ejemplo: `examplecluster.abcdefghijkl.us-west-2.redshift.amazonaws.com`
2. **Puerto** - El puerto en el que escucha tu clúster de Redshift. El valor predeterminado es `5439`.
3. **Usuario** - El usuario de Redshift con el que AirOps se conectará a la base de datos. Es una buena práctica crear un nuevo usuario para AirOps (instrucciones abajo), pero se puede usar cualquier usuario con privilegios SELECT.
4. **Contraseña** - Contraseña para el usuario anterior.
5. **Base de datos** - La base de datos de Redshift a la que AirOps se conectará.

<figure><img src="https://files.readme.io/77bfcd7-image.png" alt="" width="375"><figcaption></figcaption></figure>

## Configurar usuario y conceder acceso (para nuevos usuarios)

Para agregar una base de datos de AWS Redshift como fuente de datos en AirOps, usa un usuario existente o crea un usuario con **acceso de lectura** acceso a las tablas y esquemas a los que te gustaría acceder desde AirOps:

### 1. Crear usuario de AirOps

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

### 2. Conceder privilegios USAGE y SELECT al usuario de AirOps

Reemplaza `<schema>` y `<table>` con los nombres de esquema y tabla apropiados con los que te gustaría que AirOps interactuara.

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

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

Si quieres conceder acceso a varias tablas, puedes ejecutar la `GRANT SELECT` sentencia para cada tabla.

### 3. (Opcional) Conceder acceso a futuras tablas del esquema

Si quieres conceder acceso a todas las tablas futuras de un esquema, puedes usar el siguiente comando. Reemplázalo con el nombre de esquema apropiado.

```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/docs/es/contexto/memory-stores/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.
