> For the complete documentation index, see [llms.txt](https://docs.hockeystack.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hockeystack.com/integrations/datasyncs/connecting-your-warehouse/authenticate-redshift-export-only.md).

# Authenticate Redshift - Export Only

Connect HockeyStack to Amazon Redshift to export data into your warehouse for reporting and analysis. HockeyStack creates the destination table, loads your data, and runs subsequent exports on your chosen schedule.

You provide a Redshift database connection. HockeyStack manages the S3 staging bucket and the temporary credentials used to load data, so you do not need to create a bucket, supply AWS access keys, or attach an IAM role to Redshift for this integration.

### Before you begin

You will need:

* Access to **Data Syncs** in HockeyStack.
* A Redshift database and its SQL endpoint, port, username, and password.
* A database administrator who can create a dedicated user and grant permissions.
* Network access from HockeyStack to your Redshift endpoint.

Use a dedicated schema and a separate destination table for each sync. Let HockeyStack create the table on the first export. You do not need to define its columns yourself.

Column definitions for a Stage Data export are in the [Stage Data Export Schema](https://docs.hockeystack.com/integrations/datasyncs/configure-a-datasync-export/stage-data-export-schema).

### 1. Allow network access

Ask your network administrator to allow inbound TCP connections from HockeyStack's outbound IP addresses to your Redshift SQL port, usually **5439**. Contact your HockeyStack team for the IP addresses to allowlist.

The endpoint must be reachable from HockeyStack. If your Redshift endpoint is private, confirm connectivity with your HockeyStack team before continuing. HockeyStack connects using TLS and verifies the server certificate and hostname.

Redshift also needs to reach HockeyStack's S3 staging bucket to load exported data. If you use enhanced VPC routing or restrictive outbound policies, ask your network administrator to verify S3 connectivity for the staging bucket's region. Your HockeyStack team can provide the bucket and region details. See [AWS guidance on enhanced VPC routing](https://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html).

### 2. Create a dedicated database user

Connect to your destination database as an administrator, then run the following SQL. Replace `analytics` with your database name and `<STRONG_PASSWORD>` with a strong, unique password. You can also change the example user and schema names.

```sql
CREATE USER hockeystack_export
PASSWORD '<STRONG_PASSWORD>';

CREATE SCHEMA hockeystack
AUTHORIZATION hockeystack_export;

GRANT TEMP ON DATABASE analytics
TO hockeystack_export;

GRANT USAGE, CREATE ON SCHEMA hockeystack
TO hockeystack_export;
```

This gives the connector a dedicated schema and permission to create temporary tables. Tables created by the connector belong to this user, allowing HockeyStack to read and write data and add columns as needed. The connector user does not need to be a superuser.

See AWS documentation for [CREATE USER](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html), [CREATE SCHEMA](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_SCHEMA.html), and [GRANT](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html).

#### Using an existing schema or table

If the schema already exists, skip `CREATE SCHEMA` and grant `USAGE` and `CREATE` on that schema to the connector user.

If you need to use an existing destination table, its columns must match the exported schema. Have your administrator grant the connector user these permissions on that specific table:

```sql
GRANT SELECT, INSERT, UPDATE, DELETE, ALTER
ON TABLE hockeystack.stage_data
TO hockeystack_export;
```

Replace `hockeystack.stage_data` with the schema and table you will use. A new table created by HockeyStack is the simplest setup. For Raw Actions, use a new destination table rather than adopting an already populated table.

### 3. Add the export in HockeyStack

1. Open **Settings → Data Syncs** and add a connection.
2. Choose **Export**, then **Redshift**.
3. Enter an optional connection name, such as `Redshift — Stage Data`.
4. Choose your **Export Type**, such as **Stage Data** or **Raw Actions**.
5. Choose a one-time or recurring schedule. For recurring exports, select the daily run time in **UTC**.
6. Complete the connection fields below.

| Field    | What to enter                                                                     | Example                                |
| -------- | --------------------------------------------------------------------------------- | -------------------------------------- |
| Host     | Your Redshift SQL endpoint hostname, without a URL prefix, port, or database path | `your-redshift-endpoint.amazonaws.com` |
| Port     | The SQL port configured for your cluster or workgroup                             | `5439`                                 |
| Database | The database containing your destination schema                                   | `analytics`                            |
| Schema   | The schema created or granted access to in step 2                                 | `hockeystack`                          |
| Table    | The destination table name, without the schema prefix                             | `stage_data`                           |
| Username | Your dedicated Redshift database user                                             | `hockeystack_export`                   |
| Password | The password for that database user                                               | Your database password                 |

Use database credentials, not your AWS console login. Copy the SQL endpoint from the AWS Redshift console. For Serverless, it is available on the workgroup details page; use only the hostname portion of the connection string. See [AWS's Serverless connection guide](https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-connecting.html).

### 4. Test and start the export

1. Click **Test Connection**.
2. After validation succeeds, click **Create Connection**.
3. Open the connection details. If the sync is paused, select **Resume sync** to enable its schedule. Use the manual trigger action to start an export immediately.
4. Check the sync's status and execution history after the first run.

Connection testing checks database access, destination permissions, and the ability to load a small test file from S3. It uses disposable test objects and rolls back permission probes. It does not delete existing destination rows. A successful test does not export your dataset.

If you change the connection details after testing, test the connection again before creating it. You can save a draft and finish setup later.


---

# 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.hockeystack.com/integrations/datasyncs/connecting-your-warehouse/authenticate-redshift-export-only.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.
