Apache Superset and Amazon Redshift integration

Connect self-hosted Apache Superset to Amazon Redshift provisioned clusters or Redshift Serverless using the documented driver, passwordless IAM authentication and controlled query load.

On this page

How Apache Superset connects to Amazon Redshift

If your team runs self-hosted Superset and needs dashboards over data in Amazon Redshift, the supported route is the sqlalchemy-redshift driver, reached through a SQLAlchemy connection string of the form redshift+psycopg2://{username}:{password}@{host}:5439/{database}. Superset can also authenticate with IAM instead of a stored password when the AWS_DATABASE_IAM_AUTH feature flag is enabled. This section is for the platform engineers and data owners who will decide how Superset reaches Redshift, which identity it uses, and where the load lands. It assumes you already have a Superset deployment running or planned.

Superset is the application layer in this path. Its Flask and React web application, metadata database, optional caching layer and optional Celery workers all run in your infrastructure, and only the query workload travels to Redshift. The metadata database holds dashboards, charts, users and connection definitions, so it should stay separate from the analytics source. The caching layer and Celery workers matter here because alerts, reports, async queries and dashboard thumbnails depend on them, and those features are the ones that issue repeated queries against the warehouse. Confirm with your team which of these components will run in the same network segment as Redshift, since that determines whether the port 5439 connection can stay private or must cross a boundary you need to document.

Plan the driver into the image before you configure the connection. The Superset database catalog lists the Redshift package, so the driver is installed as a build-time dependency in the Superset container, not added by hand on a running server. Decide early between a password-based connection and IAM authentication, because IAM changes what the Superset host role must be allowed to do and how credentials rotate. Review the Superset AWS IAM documentation before you pick an approach, and ask your Redshift administrator to confirm which cluster or workgroup endpoint, database name and network path your environment uses.

What you need before connecting Superset to Redshift

Connecting Superset to Redshift depends on four things settled before any connection is configured: the driver in the Superset image, the endpoint and credentials, the choice between provisioned and Serverless, and the network path from Superset workers. Confirm each one with your Redshift team so the connection test is the last step, not the first.

The sqlalchemy-redshift driver in the image

Superset's database catalog lists the sqlalchemy-redshift package as the driver for Redshift, and the connection uses the redshift+psycopg2 dialect. Neither ships in a default image, so it must be installed into the image that runs the web server, Celery workers and any scheduled jobs. Confirm the driver version against the Superset release you run, since driver and SQLAlchemy pairings can change between releases. Record the pairing in your image build so upgrades do not silently break the connection.

Endpoint, port and database name

Redshift connections use the cluster or workgroup endpoint on port 5439, followed by the target database. Use the endpoint from the cluster or workgroup you intend to query, not a leader-node address copied from an old runbook. Confirm the database name, the schema visibility each analytics role needs, and whether the endpoint is public or private. Those three answers decide the connection string and the network rules that follow.

Database users or IAM identities

You can connect with a database user and password, or use IAM authentication behind the AWS_DATABASE_IAM_AUTH feature flag so no password is stored in Superset. Password users need a rotation process and a secret store that Superset can read. IAM users need a role that Superset assumes, with permission to request temporary database credentials. Decide which model fits your identity governance before you create the first database connection.

Provisioned or Serverless

Provisioned clusters and Redshift Serverless workgroups use different IAM actions for temporary credentials. Provisioned clusters need redshift:GetClusterCredentials, while Serverless needs redshift-serverless:GetCredentials and GetWorkgroup. Confirm which service your data sits in, because the policy, the endpoint format and the cost model all differ. Mixed estates need one connection and one policy per target.

Network path from workers to the warehouse

Every Superset process that runs queries, including web workers and Celery workers, must reach the Redshift endpoint on port 5439. Check security group rules, VPC routing, subnet placement and any private DNS or VPC endpoint in use. If Superset runs in another account or VPC, confirm peering or transit routing before debugging credentials. Network gaps often look like authentication failures, so test from the same host and network context that runs Superset.

Version pairing to confirm

Before you build the image, confirm the Superset release you run, the sqlalchemy-redshift version it supports and the Python and psycopg2 versions in the image. Treat the pairing as a release-specific check, not a fixed rule. Ask your DeployOpen team, or your own engineers, to record the tested combination in the build and to repeat the check during each Superset upgrade.

Configuration sequence for the Redshift connection

This sequence takes a self-hosted Superset from an image without a Redshift driver to a tested database connection that authenticates to either a provisioned cluster or Redshift Serverless. Each step ends with a check the reader can run before moving on.

  1. Add sqlalchemy-redshift to the Superset image

    The platform team adds the sqlalchemy-redshift package to the Superset image through the build or the Python requirements file used for the deployment, then rebuilds and redeploys the web and worker containers. The Superset database catalog lists this package for Redshift, so confirm the version pins against the Superset release you run. Done means a running container can import the driver: open a shell in the web container and confirm the package is installed in the Python environment Superset uses, then load the Redshift database option in the Superset UI.

  2. Choose password or IAM authentication

    Decide before you build the connection whether Superset will hold a database password or obtain temporary credentials from AWS at connection time. Password authentication uses the connection string form redshift+psycopg2 with a username, password, host and port 5439. IAM authentication removes stored database passwords but adds IAM permissions, a feature flag and a role for Superset to assume. Record the decision in your change request, since the rest of the sequence depends on it. Done means a written decision naming the authentication method, the Redshift deployment type (provisioned or Serverless) and the AWS account that owns the cluster or workgroup.

  3. Enable the AWS_DATABASE_IAM_AUTH feature flag

    If you chose IAM authentication, set the AWS_DATABASE_IAM_AUTH feature flag in the Superset configuration file and restart the web and worker processes so the setting loads. Superset documents this flag as the switch that enables IAM authentication for Amazon Redshift and Aurora. Keep the change in version-controlled configuration rather than editing a running container. Done means the flag appears in the loaded configuration of every web container and the restarted pods or containers pass their health checks.

  4. Grant the Redshift IAM permissions

    A cloud or security engineer creates an IAM policy for the role Superset uses. For a provisioned cluster, the policy needs redshift:GetClusterCredentials. For Redshift Serverless, it needs redshift-serverless:GetCredentials and redshift-serverless:GetWorkgroup. Scope both actions to the specific cluster, workgroup and database user where your IAM model allows it, and confirm the exact resource ARN format with AWS documentation. If Superset runs in a different AWS account from the database, add the cross-account role assumption through STS AssumeRole in the same step. Done means the engineer simulates the policy against the target resource and confirms the allowed actions, and the Superset role can request credentials from a test session.

  5. Create the Redshift database connection in Superset

    A Superset administrator opens Database Connections, selects Amazon Redshift, and enters the host, port 5439, database name and the database user that the IAM policy allows. With IAM enabled, the connection uses the Superset role to obtain short-lived credentials rather than a stored password. Keep the connection's database user a read-only account created in Redshift, and avoid using a superuser. Done means the connection record saves without errors and the object shows the expected host and database in the connection list.

  6. Test the connection and run a sample query

    Use the Test Connection action in the database settings, then open SQL Lab, select the new connection, and run a simple read-only query such as selecting the current database and user, followed by a query against a small known table. The test confirms network reachability, authentication and the driver path together. If the test fails, check the security group or VPC route to port 5439, the IAM policy simulation result and the assumed role trust policy in that order. Done means Test Connection reports success, the sample query returns the expected row, and the query appears in the Superset query history under the expected user.

Password, IAM and cross-account authentication compared

The simplest option is a Redshift database user with a password, placed in the SQLAlchemy URI using the redshift+psycopg2://{username}:{password}@{host}:5439/{database} pattern from the Superset database catalog. Superset needs only the database user and its grants, and no AWS API permissions. The trade-off is that a long-lived password must be stored in Superset's metadata database or configuration, rotated by hand and removed from every place it was copied to.

  • Secret location: the password sits in the connection configuration, so it is visible to anyone who can edit database connections in Superset.
  • Rotation: changing the password requires updating every connection that uses it and coordinating a restart or reconfiguration.
  • Least privilege: create a dedicated read-only Redshift user with grants limited to the schemas that dashboards need.
  • Audit trail: Redshift sees one shared database user, so per-person activity is hard to trace from the database side.
  • Exposure: confirm that connection secrets are encrypted at rest and that only administrators can view or edit them in Superset.

Before choosing this option, confirm with your security team whether a shared database password is acceptable under your access control policy.

How Superset roles and Redshift identities map

This table compares the layers that decide what a Superset user can read in Redshift: the Superset role, the database identity Superset connects as, the AWS role used for AssumeRole and the Redshift grants. Read it as a chain, because a permission only works when every layer agrees, and Superset itself does not create any Redshift grants.

LayerWhat it controlsWho sets itWhat to confirm
Superset roleWhich dashboards, charts and databases a user can open in SupersetSuperset admins, often mapped from identity provider groupsWhich roles can edit the Redshift connection and which can run SQL Lab against it
Database identityThe Redshift user or IAM principal Superset connects as, and so the base grants applied to queriesYour Redshift and AWS administratorsWhether one shared identity serves all users or separate identities map to separate Superset roles
AWS role for AssumeRoleThe IAM role Superset assumes through STS when the connection crosses accountsYour AWS account owners, through trust and permission policiesThe trust policy names the Superset host role and the permissions allow GetClusterCredentials or GetCredentials for the target cluster or workgroup
Redshift schemas and tablesThe schemas and tables the database identity can select fromRedshift administrators, through GRANT statementsGrants are designed and tested in Redshift, separately from Superset role settings
Row or column restrictionsWhich rows or columns a given user sees within a tableRedshift views or policies, plus Superset row level security where usedWhether restrictions are enforced in the warehouse, since a shared identity can reach any row it has been granted
Audit trailWhich identity ran each query in RedshiftYour logging configuration in Redshift and AWSWhether query logs show the database identity only, so per-user attribution needs a design decision

Securing the Redshift connection and limiting dashboard load

A Redshift connection gives every dashboard a path into your warehouse, so the identity, privileges and query behavior behind it matter as much as the charts. The cards below cover how Superset authenticates to Redshift, how to scope the IAM and database roles it uses, and how to keep dashboards from becoming an unplanned source of warehouse load.

Passwordless IAM authentication

With the AWS_DATABASE_IAM_AUTH feature flag enabled, Superset requests temporary database credentials from AWS instead of holding a static Redshift password. Confirm that the connection is configured for IAM rather than a stored password, and that no long-lived Redshift user password remains in the connection string or in Superset's metadata database. Test the flow in staging before enabling it for production dashboards.

Least-privilege IAM policies per cluster

Scope the IAM role Superset assumes to the specific resource it needs. For provisioned clusters, this means redshift:GetClusterCredentials limited to the target cluster and database user. For Redshift Serverless, it means redshift-serverless:GetCredentials and GetWorkgroup limited to the named workgroup. Avoid wildcard resource ARNs, since a broad policy lets a compromised Superset host reach every cluster in the account.

Cross-account role assumption

If the warehouse lives in a different AWS account from Superset, Superset reaches it through STS AssumeRole. The trust policy on the target role should name only the Superset host's role as principal, and the session duration should be as short as your workloads allow. Ask your AWS team who owns the trust relationship and how it is reviewed when accounts change.

Read-only Redshift roles for dashboards

Create a dedicated database user or role for Superset that holds only SELECT on the schemas its dashboards query. Keep it separate from the ETL and administrative accounts, and do not grant CREATE or write privileges on production schemas. Verify the grants with a test query from that user before publishing dashboards, because a grant mistake is easier to catch then than after a dashboard is shared widely.

Storing connection secrets

Keep any remaining secrets, such as the database connection details and the AWS role configuration, out of dashboards and out of plain configuration files in source control. Store them in a secrets manager or your deployment's secret store and inject them at runtime. Document who can edit database connections in Superset, since that permission controls which credentials every chart can use.

Limiting SQL execution and caching

Dashboards issue queries every time they refresh, so a popular dashboard can multiply warehouse load. Set query timeouts and row limits in Superset, enable result caching for dashboards that do not need live data, and review which datasets are exposed with expensive joins. Ask your Redshift administrator for workload management (WLM) queue settings that isolate Superset queries from ETL, and confirm them in a load test with realistic concurrency.

Secret key and session settings

Superset requires a user-specified SECRET_KEY before it starts, and that key protects the credentials Superset stores in its metadata database. Generate a strong value, keep it out of source control, and use PREVIOUS_SECRET_KEY when rotating it so existing encrypted values remain readable during the transition. Review session lifetime and cookie settings with your security team, since a stolen session can reuse the database access that a dashboard already has.

Controlling query load from dashboards on Redshift

Dashboards generate load in bursts that a single analyst's ad hoc query never does. Every chart on a dashboard issues its own SQL, and when many users open the same dashboard at once, or a filter change refreshes a dozen charts together, Redshift receives a fan-out of concurrent queries. Superset does not know how much your cluster or workgroup can absorb, so the limit has to be set on both sides: in Superset's caching and query behavior, and in the Redshift controls that decide how concurrent work is queued, prioritized and billed. Plan this before rollout, not after the first slow Monday morning.

On the Superset side, the levers are the caching layer, async query execution and the worker processes. The architecture documentation ties async queries and alerts and reports to the caching layer and worker components, and most installations use Redis and Celery for them. Caching lets repeated chart requests reuse results instead of hitting Redshift again, which matters most for popular shared dashboards. Async execution moves long queries off the web request path, so a slow chart does not hold a web worker. Confirm the cache timeout and async settings in the configuration documentation for your release, and decide which datasets are safe to cache for how long given how fresh the data must be. Scheduled reports and thumbnails also run queries, so size their schedules deliberately.

On the Redshift side, confirm the controls with AWS documentation before rollout rather than relying on defaults. For a provisioned cluster, review workload management (WLM) queues, concurrency and memory allocation, and whether a dedicated queue for the Superset service user can cap how much work dashboards can take. For Redshift Serverless, confirm how base capacity and maximum capacity settings, and any usage limits, bound compute and cost. Ask your AWS account team which current options apply to your edition. Give the Superset service role its own database user so these queues and limits can target it, and agree with analysts which dashboards may run on demand and which must read cached or precomputed tables.

Common Redshift connection failures and fixes

This table lists the failures teams most often hit when connecting self-hosted Superset to Redshift, with the likely cause and fix for each. Read it top to bottom when a connection test fails, then check the IAM and network rows if the error only appears on worker or scheduled jobs.

FailureLikely causeFix
Driver not found when testing the connectionThe sqlalchemy-redshift package is missing from the Superset image, so the redshift+psycopg2 dialect cannot load.Add sqlalchemy-redshift to the image build and redeploy web and worker containers together. Confirm the package is present in every container that runs queries.
Connection times out or refusesThe connection string uses a port other than 5439, the default Redshift port in the Superset catalog.Set the port to 5439 in the connection string, or confirm the port your cluster or workgroup endpoint actually uses.
AccessDenied on GetClusterCredentialsThe IAM role used by Superset lacks redshift:GetClusterCredentials for the provisioned cluster.Attach the permission to the role used by the Superset runtime, scoped to the cluster and database user, then test again.
AccessDenied on GetCredentials or GetWorkgroupThe IAM role lacks redshift-serverless:GetCredentials or redshift-serverless:GetWorkgroup for a Serverless workgroup.Grant both actions on the target workgroup. Check the workgroup ARN and region match the connection settings.
Cannot assume role in another accountThe trust policy on the target role does not allow the Superset role as a principal, or sts:AssumeRole is not allowed on the source role.Review trust and permission policies on both accounts. Confirm the external ID or session settings match what the Superset configuration expects.
Login failed for the database userThe IAM database user does not exist, was dropped, or its name differs from the one configured in Superset.Create or recreate the database user in Redshift, align the name in the connection configuration, and confirm grants on the target schemas.
Connection fails only from workers or scheduled reportsThe security group or network ACL blocks traffic from the worker subnet to the cluster or workgroup endpoint on port 5439.Allow inbound 5439 from the worker's security group or subnet. Test from the worker container, since the web container may have different network rules.
Dashboards are slow or stall the warehouseCharts issue unbounded queries across large tables, with no row limits, time filters or caching.Add time filters and default row limits, use caching for shared dashboards, and set workload management limits in Redshift for the Superset user. Confirm limits with your Redshift administrator.

Questions buyers ask about Superset and Redshift

What does a Superset and Redshift integration cost in effort, and what drives it?

Effort depends mostly on how many Redshift environments you connect, how many AWS accounts are involved, and how your access model maps to database roles. The work splits into a one-time build (image changes, driver installation, IAM role design, network paths, Redshift grants and validation) and recurring work (credential rotation review, upgrades and access reviews). Costs rise when Redshift runs across several accounts, when you need per-user or per-group database access, or when dashboards must be tested against production-sized data. Ask any partner for a quote that lists each of these as a separate line, and confirm which items are one-time and which recur. DeployOpen fixed-scope quotes follow from the written scope.

How long does it take to connect Superset to Redshift and validate it?

The duration depends on how quickly your team can grant AWS and Redshift access and how many connections must be validated. The technical connection is short once the driver is in the image and the role and network paths exist. Most of the elapsed time goes to waiting on approvals, cross-account trust setup, security review and testing dashboards against real queries. Validation should cover a connection from each Superset environment, a dashboard load under expected concurrency and a check that the database user sees only the schemas it should. Agree on a timeline only after these dependencies are listed in the written scope.

What must our team provide before the integration can start?

You need to provide the AWS accounts that host the Redshift clusters or Redshift Serverless workgroups, permission to create or update IAM roles, and a network path from the Superset workers and web servers to the Redshift endpoint on port 5439. On the database side, you need a plan for Redshift grants, including which schemas and tables each reporting role can read. Confirm whether Superset runs in the same account as Redshift or whether you will use cross-account role assumption through STS. Also confirm who owns the Superset host, the metadata database and the secret store that holds any passwords still in use.

Can our internal team set up Superset with Redshift without a partner?

Yes, a capable platform team can do it alone if it has experience with Superset deployment, AWS IAM and Redshift administration. The main risks for an internal team are IAM policy scope, cross-account trust mistakes and assuming that a connection string that works also enforces the right data access. The IAM authentication path depends on the AWS_DATABASE_IAM_AUTH feature flag, and the policies differ for provisioned clusters and Redshift Serverless, so confirm the exact permissions against the Superset AWS IAM documentation before building. A partner adds most value when you need repeatable validation, a documented runbook and an independent review of the access model before go-live.

Do I need to change the driver when I upgrade Superset?

Often yes, because Superset upgrades can change the Python environment and the supported versions of database drivers. The Redshift connection uses the sqlalchemy-redshift package with the redshift+psycopg2 dialect, so a change in the base image, the Python version or the SQLAlchemy version can break the connection. Before each upgrade, check the breaking change notes in UPDATING.md for your target version, rebuild the image with a pinned driver version and test the Redshift connection in staging. Back up the metadata database first, then run the documented upgrade commands. Keep the driver version in your build file so that an upgrade is a deliberate change, not an accident.

Should Superset use IAM authentication or a database password for Redshift?

IAM authentication is generally the stronger choice for production because it avoids a long-lived database password stored in Superset. Superset supports it for Redshift and Aurora behind the AWS_DATABASE_IAM_AUTH feature flag, using STS AssumeRole for cross-account access. Provisioned clusters need the redshift:GetClusterCredentials permission, while Redshift Serverless needs redshift-serverless:GetCredentials and GetWorkgroup. Password-based connections using the username and password in the connection string remain possible, but then the secret must be stored, rotated and kept out of dashboard owners' view. Confirm the choice with your security team before the build, because it changes the IAM policies, the rotation process and the audit trail.

How do we stop dashboards from overloading the Redshift cluster?

Control query load at three layers: the Redshift workload design, the Superset caching and the Superset query limits. On the Redshift side, use a dedicated database user or group for Superset with workload management rules that cap concurrency and runtime for that group. In Superset, enable caching so repeated dashboard loads do not hit the warehouse each time, and set row limits and timeouts for chart queries. Dashboard design matters too: a chart that scans a wide table on every filter change costs far more than a pre-aggregated table. Ask your partner to test the heaviest dashboards under expected concurrency before you open access to users.

How DeployOpen scopes and delivers the Redshift integration

DeployOpen scopes the Redshift integration in writing before any work starts. The written scope names the Redshift deployment type (provisioned cluster or Redshift Serverless), the AWS accounts and Regions involved, whether cross-account role assumption is needed, which Superset environments will connect, and who approves the database privileges and IAM policies. Deliverables and acceptance tests are agreed at the same time, so the reader knows what is handed over and how it will be checked. Most engagements are fixed-scope, and a quote follows from that written scope rather than from a generic price list.

Delivery happens inside your own AWS accounts and under your change control. DeployOpen builds the Superset image with the sqlalchemy-redshift driver, configures the database connection and IAM authentication behind the AWS_DATABASE_IAM_AUTH feature flag, and wires the STS role chain where the warehouse sits in another account. Testing covers a connection from each Superset environment, token expiry and refresh under load, denial tests for principals that should not reach the cluster or workgroup, and a check that dashboard queries land under the agreed concurrency limits. The configuration, IAM policies and runbook are documented so your platform team can operate the integration without us.

Ongoing support and upgrade work can be covered by a retainer after handover. Superset releases change configuration and dependencies, so a retainer typically covers patching the image, retesting the Redshift connection against new Superset and driver versions, and reviewing IAM policy changes. Confirm during scoping which of these your team will own, what response expectations apply to your environment, and how changes to the Redshift side, such as a cluster resize or a move to a new workgroup, are handled and priced.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.