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

# Redshift Setup and Configuration

> Set up Amazon Redshift as an Inflection data source and export destination.

## Export Inflection Data to Redshift

For information on tables and schemas that Inflection exports to Redshift, please read this

<AccordionGroup>
  <Accordion title="Set up Export to Redshift in Inflection">
    These steps need to be run by someone with access to

    1. Go to **Connections → Data Connections**, then click **Add new connection**.

           <img src="https://mintcdn.com/inflection-4b2c0de4/N4VRWuxaoalXbMy_/images/connections/warehouses/redshift/01.png?fit=max&auto=format&n=N4VRWuxaoalXbMy_&q=85&s=931b36ea8eb41f8b585b35cba34b8b55" alt="Add new connection button on the Data Connections page" width="3840" height="1868" data-path="images/connections/warehouses/redshift/01.png" />

    2. **Choose your platform**: Select **Redshift** as your destination platform.

    3. **Select connection type**: Choose **Export Data to Redshift**.

           <img src="https://mintcdn.com/inflection-4b2c0de4/N4VRWuxaoalXbMy_/images/connections/warehouses/redshift/02.png?fit=max&auto=format&n=N4VRWuxaoalXbMy_&q=85&s=313510333c83ee78353f28c7ea856383" alt="Choosing Redshift as the platform and Export Data to Redshift as the connection type" width="513" height="447" data-path="images/connections/warehouses/redshift/02.png" />

    4. **Whitelist IPs**

       For Redshift connection, you need to whitelist given IPs in your AWS dashboard before proceeding to setup page

           <img src="https://mintcdn.com/inflection-4b2c0de4/N4VRWuxaoalXbMy_/images/connections/warehouses/redshift/03.png?fit=max&auto=format&n=N4VRWuxaoalXbMy_&q=85&s=c8466466ebb63f8930f3b261c397b22e" alt="IP addresses to whitelist in your AWS dashboard" width="510" height="462" data-path="images/connections/warehouses/redshift/03.png" />

    5. **Enter your Redshift credentials**

       Give a name for your data warehouse connection and fill in your credentials.

       * Account name - a human-friendly name for this connection
       * Username, password - service account credentials for redshift
       * Database, schema and port - name of the database, schema and port to be used by Inflection.

    6. Click **Create Connection** to set up the connection. Note that syncing will NOT BEGIN and connection will be in INACTIVE state until the credentials and destination tables are validated by your Inflection team.
  </Accordion>

  <Accordion title="Set up Redshift to accept Inflection Data">
    We provide a custom SQL script tailored to your configuration. You'll need to run this script to create the export tables in your DW.

    <img src="https://mintcdn.com/inflection-4b2c0de4/N4VRWuxaoalXbMy_/images/connections/warehouses/redshift/04.png?fit=max&auto=format&n=N4VRWuxaoalXbMy_&q=85&s=ba243eccae7b11378f637d23449370ac" alt="Sample SQL. Do not use this directly. Please refer to the SQL shown on inflection UI for your connection" width="2000" height="602" data-path="images/connections/warehouses/redshift/04.png" />

    The script creates tables with the necessary structure and permissions (INSERT, UPDATE, DELETE) for Inflection to write data.
  </Accordion>

  <Accordion title="Submit Setup for Activation">
    Once your credentials are saved and your data team has created the required tables in your warehouse, your setup is complete.

    At this point:

    * Inflection's team will validate the setup and activate the sync for you.
    * No additional steps are required from your side.
      * Optionally, you may test or delete the connection at this stage
    * You will be notified once the sync has started and data is being sent.

    <Info>
      Activation may take up to two business days. Please ensure your data team notifies you once your tables are set up in your data warehouse.
    </Info>
  </Accordion>
</AccordionGroup>

## Import Product Activity from Redshift to Inflection

For information on generic import guidelines, please read this

<AccordionGroup>
  <Accordion title="Set up Inflection to read from Redshift">
    1. In the Inflection UI, select Connections on the left sidebar > "Data Connections" > "Add new Connection". Select Redshift to enter connection details and proceed with the setup workflow.

           <img src="https://mintcdn.com/inflection-4b2c0de4/N4VRWuxaoalXbMy_/images/connections/warehouses/redshift/05.png?fit=max&auto=format&n=N4VRWuxaoalXbMy_&q=85&s=5813d674511d1bf927918980ff001694" alt="Add new Connection option under Data Connections in the Inflection UI" width="710" height="648" data-path="images/connections/warehouses/redshift/05.png" />

    2. Copy the IPs to whitelist in your AWS dashboard. Select "I've Whitelisted the IPs" once you have completed that step.

           <img src="https://mintcdn.com/inflection-4b2c0de4/0Fy2fPaKm7bhQlZX/images/connections/warehouses/redshift/06.png?fit=max&auto=format&n=0Fy2fPaKm7bhQlZX&q=85&s=7110f710c0b96eb160ff670ea05e7d84" alt="IPs to whitelist with the I've Whitelisted the IPs confirmation" width="464" height="514" data-path="images/connections/warehouses/redshift/06.png" />

    3. Name your connection in the Connection name field, add your Redshift connection details, and save the connection:

       * Host
       * Port
       * Database
       * User
       * Password

           <img src="https://mintcdn.com/inflection-4b2c0de4/0Fy2fPaKm7bhQlZX/images/connections/warehouses/redshift/07.png?fit=max&auto=format&n=0Fy2fPaKm7bhQlZX&q=85&s=8362145bfeb49f2e79caa8a22859087b" alt="Redshift connection details form" width="460" height="726" data-path="images/connections/warehouses/redshift/07.png" />
  </Accordion>

  <Accordion title="Set up Redshift to allow Inflection reads">
    We need specific permissions to be granted for Redshift sync to work:

    1. Create a user to be used by inflection to read and export data. This user should be created with password (Ref: [https://docs.aws.amazon.com/redshift/latest/dg/r\_CREATE\_USER.html](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_USER.html))

    2. Inflection needs an `inflection` schema to maintain state. Customers can do one of two things for this:

       1. Create a schema named `inflection` within the database that is being connected and then grant all privileges to that schema.

          ```sql theme={null}
          GRANT ALL PRIVILEGES ON SCHEMA inflection TO <inflection_user_name>;
          ```

       2. Grant schema create permission for Inflection to automatically do above

          ```sql theme={null}
          GRANT CREATE ON DATABASE <database_name> TO <inflection_user_name>;
          ```

    3. Grant usage access to the schema being connected to the new user

    ```sql theme={null}
    GRANT USAGE ON SCHEMA <schema_being_connected> TO <inflection_user_name>;
    ```

    4. Grant select privilege on the specific tables being connected or to all the tables in the schema

    ```sql theme={null}
    # Grant select on all tables in schema
    GRANT SELECT ON ALL TABLES IN SCHEMA <schema_being_connected> TO <inflection_user_name>;

    # Grant select on specific tables in the schema
    GRANT SELECT ON TABLE <schema_being_connected>.<table_being_connected> TO <inflection_user_name>;
    ```

    5. Make sure to Whitelist the IPs given from the UI

    Connection creation notes:

    * Use the hostname and port from `endpoint` details in the redshift cluster details

          <img src="https://mintcdn.com/inflection-4b2c0de4/0Fy2fPaKm7bhQlZX/images/connections/warehouses/redshift/08.png?fit=max&auto=format&n=0Fy2fPaKm7bhQlZX&q=85&s=565f826ae96cf014e86b18ab882a0228" alt="Redshift cluster endpoint details showing hostname and port" width="2848" height="1124" data-path="images/connections/warehouses/redshift/08.png" />

      * Here, the hostname would be `redshift-cluster-1.cmjhsmtjaqgq.ap-south-1.redshift.amazonaws.com` and the port would be `5439`
      * Use the username and password for the user that was created for the connection
  </Accordion>
</AccordionGroup>
