Skip to content

Fix(redshift): add missing db_user parameter for IAM auth#5687

Open
synthpieter wants to merge 3 commits intoTobikoData:mainfrom
synthpieter:fix/redshift-iam-db-user
Open

Fix(redshift): add missing db_user parameter for IAM auth#5687
synthpieter wants to merge 3 commits intoTobikoData:mainfrom
synthpieter:fix/redshift-iam-db-user

Conversation

@synthpieter
Copy link

@synthpieter synthpieter commented Feb 2, 2026

Problem

SQLMesh's Redshift connection configuration was missing the db_user parameter, which is required by the redshift_connector library when using IAM authentication.

When enabling iam (iam: True) in the connection config it throws, understandably so, an InterfaceError

redshift_connector.error.InterfaceError: Connection parameter db_user must be specified when using IAM authentication

However, it was not allowed to add this parameter to the config.

Error: Invalid 'redshift' connection config:
  Invalid field 'db_user':
    Extra inputs are not permitted

Verify your config.yaml and environment variables.

So iam authentication was not really useable.

Solution

Added the db_user field to the RedshiftConnectionConfig class in three places:

  1. Documentation - Added parameter description in the docstring and docs
  2. Field Declaration - Added db_user: t.Optional[str] = None to the class
  3. Connection Kwargs - Added "db_user" to the _connection_kwargs_keys property
  4. Tests - Added db_user to corresponding test.

Usage

With this fix, you can now configure Redshift IAM authentication in config.yaml:

gateways:
  redshift:
    connection:
      type: redshift
      database: your_database
      host: your-cluster.region.redshift.amazonaws.com
      port: 5439
      cluster_identifier: your-cluster
      iam: True
      db_user: your_db_username

Fixes #2146

Disclaimer

This is my first contribution to an open source project ever, so please let me know if this is the right way of doing things :)
I locally give the fix a spin and it seems to fix the problem!

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2026

CLA assistant check
All committers have signed the CLA.

@synthpieter synthpieter force-pushed the fix/redshift-iam-db-user branch from 5c38736 to f20bb1b Compare February 2, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support IAM profile authentication for Redshift

2 participants