Skip to main content

Connect to Amazon Redshift

Amazon Redshift is a fully managed, petabyte-scale data warehouse service built on PostgreSQL.

What you can do with Amazon Redshift in Retool

After you create an Amazon Redshift resource in Retool, you can:

  • Read and display data with SQL queries.
  • Insert, update, and delete records using GUI mode.
  • Build admin panels and dashboards backed by your data warehouse.
  • Automate data workflows across your Redshift cluster.

Before you begin

To connect Amazon Redshift to Retool, you need the following:

  • Redshift cluster: A running Amazon Redshift cluster or serverless workgroup.
  • Credentials: A database username and password, or AWS IAM credentials with permissions to generate temporary cluster credentials.
  • Network access: Your Redshift cluster must accept connections from Retool's IP addresses.
  • Retool permissions: Ability to create and manage resources in your organization.

Create an Amazon Redshift resource

Follow these steps to create an Amazon Redshift resource in your Retool organization.

Create a new resource

In your Retool organization, navigate to Resources in the main navigation and click Create newResource. Search for "Redshift" and click the Amazon Redshift tile to begin configuration.

Best practice

Use folders to organize your resources by team, environment, or resource type. This helps keep your resource list manageable as your organization grows.

Configure general settings

Specify a name and description for the resource that indicates which Redshift cluster it connects to. The description provides more context to users and Assist about how to use the resource.

Example nameExample description
Analytics warehouseRedshift cluster containing product analytics and event data.
Reporting warehouse (read only)Read-only Redshift cluster used for BI dashboards.

Configure resource credentials

Configure the connection settings for your Amazon Redshift resource.

Amazon Redshift resource configuration form.

Host

The hostname of your Redshift cluster.

Example
cluster.au48w6x.us-west-2.redshift.amazonaws.com

Port

The port your Redshift cluster listens on. Defaults to 5439.

Database name

The name of the Redshift database to connect to.

Example
hn_api_production

Configure authentication

Choose an authentication method based on your security requirements.

Authentication methodUse cases
User and passwordStandard authentication using a database username and password.
AWS IAM authenticationTemporary, short-lived credentials generated through AWS IAM, avoiding long-lived database passwords.
Option A: User and password (Recommended)
  1. Set Authentication to User and Password.
  2. Enter the Database username. The default username for a new cluster is retool.
  3. Enter the Database password.
Option B: AWS IAM authentication
  1. Set Authentication to AWS IAM Authentication. Retool automatically enables SSL/TLS for this method.
  2. Enter the Database username to connect as.
  3. Enter the Cluster Identifier for your Redshift cluster.
  4. Enter the AWS Region where your cluster is located.
  5. Enter an AWS access key ID and AWS secret key ID with permissions to call GetClusterCredentials, or optionally provide a Role to assume (ARN) to use a different IAM role.

Use SSL/TLS

Caution

Configuring SSL/TLS is optional but highly recommended.

Enable Use SSL/TLS for encrypted connections to your Redshift cluster.

Enable SSH tunnel

Connect through an SSH tunnel to reach Redshift clusters in private networks. Enter the SSH host, port, username, and private key for your bastion server.

Configure advanced options

Configure optional settings available under the Advanced options section of the resource configuration form.

Disable converting queries to prepared statements

Retool converts queries to prepared statements by default to improve performance and prevent SQL injection. Enable this option only if your use case requires disabling that behavior.

Show write GUI mode only

Enable this to hide SQL mode from query writers, restricting them to GUI mode for write operations. Use this to reduce the risk of unintended data modifications.

Outbound region

If your organization uses outbound regions, select the region that should be used for requests to Redshift. This controls which geographic region your requests originate from.

Test the connection

Click Test connection to verify Retool can connect to Redshift. If the test fails, check the following:

  • Network access: Ensure your Redshift cluster accepts connections from Retool's IP addresses (cloud) or your Retool instance's network (self-hosted).
  • Credentials: Verify the username and password, or AWS IAM permissions, are correct and haven't expired.
  • Hostname and port: Confirm the hostname is correct and Redshift is listening on the specified port.
  • SSL/TLS: If your cluster requires SSL, enable Use SSL/TLS.
Use Debug Tools for detailed connection information

After testing the connection, click View in console to open the Debug Tools console. The console displays the test query executed, its response, execution time, and error details if the test fails. This information is helpful for troubleshooting connection issues.

Save the resource

Click Create resource to save your Amazon Redshift resource. You can now use it in queries across your Retool apps and automations.

Interact with Amazon Redshift data

Once you've created an Amazon Redshift resource, you can interact with Redshift data using Retool.

Switch to the new app builder

Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.

  • To use Amazon Redshift data in the app builder, reference the resource in the prompt with @, such as @Analytics warehouse. Refer to the data and functions documentation to learn more.
  • For classic apps, workflows, and agents, refer to the SQL queries documentation to learn how to write a resource query.

Best practices

Follow these best practices to maintain the security of your Amazon Redshift resource.

  • Apply least privilege: Grant database users only the minimum permissions needed. Use read-only credentials for resources used only for reading data.
  • Prefer AWS IAM authentication: Use AWS IAM authentication instead of a long-lived database password where possible, since IAM-generated credentials are temporary and automatically rotated.
  • Enable SSL/TLS: Use SSL/TLS encryption for connections to protect data in transit, especially when connecting over the internet.
  • Use resource environments: Configure multiple resource environments to maintain separate Redshift clusters or credentials for production, staging, and development.