Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Redshift

Access configuration details to connect Soda to an Amazon Redshift data source.

Connection configuration reference

Install the following package:

pip install soda-redshift

Data source YAML

Create a ds_config.yml file:

soda data-source create -f ds_config.yml

Soda supports two authentication methods: a database password, or temporary credentials generated from AWS access keys.

ds_config.yml
type: redshift
name: my_redshift
connection:
  host: ${env.REDSHIFT_HOST}
  port: 5439
  database: ${env.REDSHIFT_DB}
  user: ${env.REDSHIFT_USER}
  password: ${env.REDSHIFT_PW}

Soda uses your AWS keys to request temporary database credentials for user with GetClusterCredentials. This method works with provisioned clusters only. For Redshift Serverless, use password authentication.

ds_config.yml
type: redshift
name: my_redshift
connection:
  host: ${env.REDSHIFT_HOST}
  port: 5439
  database: ${env.REDSHIFT_DB}
  user: ${env.REDSHIFT_USER}
  access_key_id: ${env.REDSHIFT_AWS_ACCESS_KEY_ID}
  secret_access_key: ${env.REDSHIFT_AWS_SECRET_ACCESS_KEY}
  region: ${env.REDSHIFT_REGION} # e.g., us-east-1
  # optional
  session_token: ${env.REDSHIFT_AWS_SESSION_TOKEN}
  role_arn: ${env.REDSHIFT_ROLE_ARN} # e.g., arn:aws:iam::123456789012:role/MyRole
  cluster_identifier: ${env.REDSHIFT_CLUSTER_ID}
  • Set region to your cluster's region. If you omit it, Soda uses eu-west-1.

  • If you omit cluster_identifier, Soda uses the first part of host. Set it explicitly if host is an IP address or a custom DNS name.

  • If you set role_arn, Soda assumes that role before requesting credentials.

  • user must already exist in the database. Soda doesn't create it.

  • Don't combine password with access keys. If both are present, Soda uses the access keys and ignores the password.

Optional connection fields

Field
Description

connect_timeout

Connection timeout in seconds.

keepalives_idle

Seconds of inactivity before a TCP keepalive is sent.

keepalives_interval

Seconds between keepalive retries.

keepalives_count

Number of lost keepalives before the connection is considered dead.

profile_name

Used when assuming role_arn; doesn’t replace the access keys.

Data source YAML

Create the config file:

The data source configuration YAML should look like the following:

Connection test

Test the data source connection:


Case sensitivity

Redshift is usually case-insensitive and interprets all identifiers (e.g. table and column names) as lower case regardless of the original input. However, Soda enforces case-sensitive identifiers for its sessions.

Starting with Soda v4, all queries executed against Redshift are now run with enable_case_sensitive_identifier=on, regardless of your database’s default setting. This ensures consistent handling of table and column names, including those containing uppercase characters.

If you previously relied on case-insensitive behavior (the default in Soda v3), you may need to review and update any custom SQL, filters, or references to identifiers to ensure they match the exact case used in your Redshift schema.

This change prevents onboarding issues for mixed-case identifiers, but it also means all SQL executed by Soda is now case sensitive.


Required permissions

Redshift uses a permission model similar to PostgreSQL.

Create a dedicated user:

If you use IAM authentication, the AWS identity also needs permission to callredshift:GetClusterCredentials for the cluster, database, and user.


You are not logged in to Soda and are viewing the default public documentation. Learn more about Licensing & documentation access.

Last updated

Was this helpful?