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

# Amazon Redshift

## Overview

Stigg's integration with Amazon Redshift allows you to export your product catalog, customer, and subscription data directly to your Redshift cluster for custom reporting and analysis.

<Note>
  Stigg's native data export integrations are included in the Scale plan, and are also available as an optional add-on to the Growth plan. See Stigg's pricing for more details.
</Note>

<Card title="View the full entity schema" icon="sitemap" href="./schema">
  See every table and column exported to your destination, organized by entity group.
</Card>

## Setting up the integration

### Prerequisites

* An Amazon Redshift cluster that's publicly accessible, in a public subnet with an Internet Gateway route (private clusters can connect via SSH tunneling — [contact Stigg support](mailto:support@stigg.io))
* An S3 bucket in the same AWS region, used for staging data before it's loaded into Redshift
* A Redshift database user with limited permissions for Stigg to connect as
* An IAM role (recommended) or IAM user with permission to access the staging bucket and get cluster credentials

<Note>
  If your security posture requires IP allowlisting, Stigg connects from a static IP: `35.192.85.117/32` (US Cloud) or `104.199.49.149/32` (EU Cloud). For private or self-hosted deployments, [contact Stigg support](mailto:support@stigg.io) for the egress IP.
</Note>

<Steps>
  <Step title="Create a limited Redshift user">
    Connect to your cluster with a SQL client and create a user for Stigg:

    <CodeGroup>
      ```sql create-user.sql theme={null}
      CREATE USER <username> PASSWORD '<password>';
      ```
    </CodeGroup>

    Grant it permission to create objects and use temporary tables:

    <CodeGroup>
      ```sql grant.sql theme={null}
      GRANT CREATE, TEMPORARY ON DATABASE <database> TO <username>;
      ```
    </CodeGroup>

    <Note>
      If you're pre-creating the schema yourself rather than letting Stigg create it on first sync, run `GRANT ALL ON schema <schema> TO <username>;` instead, and remove the database-level `CREATE` grant while keeping `TEMPORARY`.
    </Note>

    <Warning>
      Avoid these characters in the password: `@ [ ] / ? # " \ + & : %` and spaces.
    </Warning>
  </Step>

  <Step title="Allow network access">
    In the Redshift console, find your cluster's endpoint under **Clusters > General information**, then open its VPC security group and edit **Inbound rules** to add a custom TCP rule for the connecting IP:

    | Setting  | Value                                               |
    | -------- | --------------------------------------------------- |
    | Protocol | Custom TCP                                          |
    | Port     | The port your cluster listens on. Typically `5439`. |
    | Source   | Stigg's static IP (see above)                       |
  </Step>

  <Step title="Create the S3 staging bucket">
    In the [S3 console](https://console.aws.amazon.com/s3/), create a bucket for staging data before it's loaded into Redshift. AWS recommends disabling ACLs and blocking all public access. Optionally add a lifecycle rule to delete staged objects after 2 days.
  </Step>

  <Step title="Create the IAM access policy">
    Create an IAM policy granting the permissions Stigg needs, replacing `BUCKET_NAME`, `REGION_NAME`, `ACCOUNT_ID`, `CLUSTER_NAME`, `USERNAME`, and `DATABASE_NAME` with your own values:

    <CodeGroup>
      ```json policy.json theme={null}
      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Effect": "Allow",
                  "Action": "s3:ListBucket",
                  "Resource": "arn:aws:s3:::BUCKET_NAME"
              },
              {
                  "Effect": "Allow",
                  "Action": [
                      "s3:PutObject",
                      "s3:GetObject",
                      "s3:DeleteObject"
                  ],
                  "Resource": "arn:aws:s3:::BUCKET_NAME/*"
              },
              {
                  "Effect": "Allow",
                  "Action": "redshift:GetClusterCredentials",
                  "Resource": [
                      "arn:aws:redshift:REGION_NAME:ACCOUNT_ID:dbuser:CLUSTER_NAME/USERNAME",
                      "arn:aws:redshift:REGION_NAME:ACCOUNT_ID:dbname:CLUSTER_NAME/DATABASE_NAME"
                  ]
              }
          ]
      }
      ```
    </CodeGroup>

    <Note>
      If the bucket uses a customer-managed KMS key, also add a statement granting `kms:GenerateDataKey` and `kms:Decrypt` on `arn:aws:kms:REGION_NAME:ACCOUNT_ID:key/KEY_ID`.
    </Note>
  </Step>

  <Step title="Create the IAM role">
    In the [AWS IAM console](https://console.aws.amazon.com/iam/), create a role using **Custom trust policy**. The Stigg connect form shows a trust policy prepopulated with the identifiers for your account — paste it in as-is. Attach the access policy from the previous step, name the role something recognizable (e.g. `transfer-role`), and record its ARN.

    <Note>
      Alternatively, create an IAM user with programmatic access, attach the same access policy, and use its Access Key ID and Secret Access Key when connecting below.
    </Note>
  </Step>

  <Step title="Connect Stigg with Redshift">
    In [Stigg](https://app.stigg.io/), navigate to **Integrations > Apps > Amazon Redshift**.

    Enter the following information in the connection form:

    | Field          | Description                                                                                       |
    | -------------- | ------------------------------------------------------------------------------------------------- |
    | Host           | The Redshift cluster endpoint                                                                     |
    | Port           | The port Redshift listens on. Defaults to `5439`.                                                 |
    | Database       | The name of the target database                                                                   |
    | Cluster        | The Redshift cluster identifier                                                                   |
    | Schema         | The schema where Stigg will create and sync tables                                                |
    | Username       | The Redshift user created above                                                                   |
    | IAM Role ARN   | The ARN of the IAM role created above (or Access Key ID / Secret Access Key if using an IAM user) |
    | Staging bucket | The S3 bucket name and region used for staging                                                    |

    Click **Test & connect**.
  </Step>

  <Step title="Select entities to export">
    After entering your connection details, expand the **Entities to export** section to choose which entity groups to include in the sync. All groups are selected by default.

    See [Exported entities](./overview#exported-entities) for a description of each group.
  </Step>
</Steps>


## Related topics

- [Exported entities](/documentation/importing-and-exporting-data/export/overview.md#exported-entities)
- [Sync process, schedule, manual sync, and sync history](/documentation/importing-and-exporting-data/export/overview.md#sync-process)
