Redshift
Access configuration details to connect Soda to an Amazon Redshift data source.
Connection configuration reference
Install the following package:
pip install soda-redshiftData source YAML
Create a ds_config.yml file:
soda data-source create -f ds_config.ymlSoda supports two authentication methods: a database password, or temporary credentials generated from AWS access keys.
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.
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
regionto your cluster's region. If you omit it, Soda useseu-west-1.If you omit
cluster_identifier, Soda uses the first part ofhost. Set it explicitly ifhostis an IP address or a custom DNS name.If you set
role_arn, Soda assumes that role before requesting credentials.usermust already exist in the database. Soda doesn't create it.Don't combine
passwordwith access keys. If both are present, Soda uses the access keys and ignores the password.
Optional connection fields
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:
Last updated
Was this helpful?
