For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
      • AstroFully-managed data operations, powered by Apache Airflow.
      • Astro Private CloudRun Airflow-as-a-service in your environment.
      • Professional ServicesExpert Airflow services for your enterprise's success.
    • Tools
      • Cosmos
      • Orbiter
      • CLI
      • AI SDK
      • Agents
      • Blueprint
      • UpdatesThe State of Airflow 2026See the insights from over 5,800 data practitioners in the full report. Download Now ➔
  • Customers
  • Docs
    • Insights
      • Blog
      • Webinars
      • Resource Library
      • Events
    • Education
      • Academy
      • What is Airflow?
  • Pricing
Get Started Free
    • Overview
      • Anyscale
      • Azure Blob Storage
      • Azure Container Instances
      • Azure Data Factory integration
      • BigQuery
      • Cohere
      • Common AI
      • dbt
      • DuckDB
      • Entra Workload Identity
      • Execute notebooks
      • Fivetran
      • Great Expectations
      • Kafka
      • Marquez
      • MongoDB
      • MS SQL Server
      • OpenAI
      • OpenSearch
      • pgvector
      • Pinecone
      • PostgreSQL
      • Qdrant
      • Ray
        • Redshift connection
        • Redshift integration
      • SageMaker
      • Soda data quality
      • Weaviate
      • Weights and Biases
    • Glossary

Product

  • Platform Overview
  • Astro
  • Astro Observe
  • Astro Private Cloud
  • Security & Trust
  • Pricing

Tools & Services

  • Cosmos
  • Docs
  • Professional Services
  • Product Updates

Use Cases

  • AI Ops
  • Data Observability
  • ETL/ELT
  • ML Ops
  • Operational Analytics
  • All Use Cases

Industries

  • Financial Services
  • Gaming
  • Retail
  • Manufacturing
  • Healthcare
  • All Industries

Resources

  • Academy
  • eBooks & Guides
  • Blog
  • Webinars
  • Events
  • The Data Flowcast Podcast
  • All Resources

Airflow

  • What is Airflow
  • Airflow on Astro
  • Airflow 3.0
  • Airflow Upgrades
  • Airflow Use Cases
  • Airflow 2.x End of Life

Company

  • Our Story
  • Customers
  • Newsroom
  • Careers
  • Contact

Support

  • Knowledge Base
  • Status
  • Contact Support
GitHubYouTubeLinkedInx
  • Legal
  • Privacy
  • Terms of Service
  • Consent Preferences

  • Do Not Sell or Share My Personal information
  • Limit the Use Of My Sensitive Personal Information

Apache Airflow®, Airflow, and the Airflow logo are trademarks of the Apache Software Foundation. Copyright © Astronomer 2026. All rights reserved.

LogoLogo
On this page
  • Prerequisites
  • Get connection details
  • Create your connection
  • How it works
  • See also
Integrations & connectionsRedshift

Create a Redshift connection in Airflow

Built with

Info

This page has not yet been updated for Airflow 3. The concepts shown are relevant, but some code may need to be updated. If you run any examples, take care to update import statements and watch for any other breaking changes.

Amazon Redshift is a data warehouse product from AWS. Integrating Redshift with Airflow allows you to automate, schedule and monitor a variety of tasks. These tasks include creating, deleting, and resuming a cluster, ingesting or exporting data to and from Redshift, as well as running SQL queries against Redshift.

This document covers two different methods to connect Airflow to Amazon Redshift:

  • Using database (DB) user credentials
  • Using IAM credentials
  • Using IAM role

Tip

If you’re an Astro user, Astronomer recommends using workload identity to authorize to your Deployments to Redshift. This eliminates the need to specify secrets in your Airflow connections or copying credentials file to your Airflow project. See Authorize Deployments to your cloud.

Prerequisites

  • The Astro CLI.
  • A locally running Astro project.
  • Permissions to access to your Redshift cluster. See Using IAM authentication and Authorizing Amazon Redshift to access other AWS services.

Get connection details

Db Creds

DB user credentials can be used to establish a connection to an Amazon Redshift cluster. While straightforward to use, this approach lacks the strong security and user access controls provided by identity and access management (IAM). Connecting this way requires the following information:

  • Cluster identifier
  • Database name
  • Port
  • User
  • Password

Complete the following steps to retrieve these values:

  1. In your AWS console, select the region that contains your Redshift cluster, open the Redshift cluster dashboard, then open your cluster.

  2. From the General information section, copy the Cluster identifier and Endpoint.

  3. Open the Properties tab and copy the Database name and Port.

  4. Create a Redshift user and grant a role so that Airflow can access Redshift through the user. Copy the username and password.

Iam Creds

You can use IAM credentials to connect Airflow to Redshift. This approach lets you use IAM credentials and limits Airflow’s permissions. The limitation of this method is that you must include an AWS credentials file in your Airflow project.

Following information is required:

  • Cluster identifier
  • Database name
  • Port
  • Region
  • IAM user
  • AWS credentials file

Complete the following steps to retrieve these values:

  1. In your AWS console, select the region that contains your Redshift cluster, open the Redshift cluster dashboard, then open your cluster.

  2. Open the General information tab, then copy the Cluster identifier and Endpoint.

  3. Open the Properties tab and copy the Database name and Port.

  4. Open your IAM dashboard, go to Users and select your user. Then, go to Permissions and follow the AWS documentation to ensure that the IAM user is authorized to connect to Redshift and perform SQL operations.

  5. Generate a new access key ID and secret access key.

Iam Role

You can use AWS’s Assume Role method to automatically generate temporary credentials to connect to Redshift. This is useful to grant temporary access to limited-privilege IAM users or roles without storing any credentials on disk. The following information is required to create the connection:

  • Cluster identifier
  • Database name
  • Port
  • Region
  • IAM role ARN

Complete the following steps to retrieve these values:

  1. In your AWS console, select the region that contains your Redshift cluster, open the Redshift cluster dashboard, then open your cluster.

  2. Open the General information tab, then copy the Cluster identifier and Endpoint.

  3. Open the Properties tab and copy the Database name and Port.

  4. Open your IAM dashboard, and follow the AWS documentation to create an IAM role and attach an IAM Policy to access the required services, for example AWS Redshift.

  5. Edit the trust relationship of the role created in Step 4 to add a trust policy that allows the IAM role to assume your new role.

    1{
    2 "Version": "2012-10-17",
    3 "Statement": [
    4 {
    5 "Effect": "Allow",
    6 "Principal": {
    7 "AWS": "arn:aws:iam::<your-aws-account>:role/<your-role-name>"
    8 },
    9 "Action": "sts:AssumeRole"
    10 }
    11 ]
    12}
  6. Copy the ARN of the role.

Create your connection

Info

Astro users can also create connections using the Astro Environment Manager, which stores connections in an Astro-managed secrets backend. These connections can be shared across multiple deployed and local Airflow environments. See Create Airflow connections in the Astro UI.

Db Creds
  1. Open your Astro project and add the following line to your requirements.txt file:

    apache-airflow-providers-amazon

    This will install the Amazon provider package, which makes the Amazon Redshift connection type available in Airflow.

  2. Run astro dev restart to restart your local Airflow environment and apply your changes in requirements.txt.

  3. In the Airflow UI for your local Airflow environment, go to Admin > Connections. Click + to add a new connection, then select the connection type as Amazon Redshift.

  4. Fill out the following connection fields using the information you retrieved from Get connection details:

    • Connection Id: Enter a name for the connection.
    • Host: Enter the cluster Endpoint.
    • Database: Enter the Database name.
    • User: Enter the DB user username.
    • Password: Enter the DB user password.
    • Port: Enter the Port.
  5. Click Test. After the connection test succeeds, click Save.

    aws-connection-db-creds

Iam Creds
  1. Open your Astro project and add the following line to your requirements.txt file:

    apache-airflow-providers-amazon

    This will install the Amazon provider package, which makes the Amazon Redshift connection type available in Airflow.

  2. Copy the aws credentials file to the include directory of your Astro project. It should have the following format:

    1# ~/.aws/credentials
    2[<your-profile-name>]
    3aws_access_key_id="your_aws_access_key_id"
    4aws_secret_access_key="your_aws_secret_access_key"
  3. Run astro dev restart to restart your local Airflow environment and apply your changes in requirements.txt.

  4. In the Airflow UI for your local Airflow environment, go to Admin > Connections. Click + to add a new connection, then select the connection type as Amazon Redshift.

  5. Enter a name for the connection in the Connection Id field.

  6. Copy the following JSON template into the Extra field, then replace the placeholder values with the information you retrieved in Get connection details.

    1{
    2 "iam": true,
    3 "cluster_identifier": "<your-cluster-identifier>",
    4 "port": 5439,
    5 "region": "<your-region>",
    6 "db_user": "<your-user>",
    7 "database": "<your-database>",
    8 "profile": "<your-profile-name>"
    9}
  7. Click Test. After the connection test succeeds, click Save.

    aws-connection-iam-creds

Iam Role
  1. Open your Astro project and add the following line to your requirements.txt file:

    apache-airflow-providers-amazon

    This will install the Amazon provider package, which makes the Amazon Redshift connection type available in Airflow.

  2. Run astro dev restart to restart your local Airflow environment and apply your changes in requirements.txt.

  3. In the Airflow UI for your local Airflow environment, go to Admin > Connections. Click + to add a new connection, then select the connection type as Amazon Redshift.

  4. Complete the following connection fields using the information you retrieved from Get connection details:

    • Connection Id: Enter a name for the connection.
    • Host: Enter the cluster Endpoint.
    • Database: Enter the Database name.
    • Port: Enter the Port.
    • Extra:
      1 {
      2 "role_arn": "<your-role-arn>",
      3 "region_name": "<your-region>"
      4 }
  5. Click Test. After the connection test succeeds, click Save.

How it works

Airflow uses the Amazon Redshift Python Connector to connect to Redshift through the RedshiftSQLHook.

See also

  • Apache Airflow Amazon provider package documentation
  • Redshift modules in the Airflow Registry
  • Import and export Airflow connections using Astro CLI