Redshift Profile
Authentication Methods
Password-based authentication
company-name:target: devoutputs:dev:type: redshifthost: hostname.region.redshift.amazonaws.comuser: usernamepassword: password1port: 5439dbname: analyticsschema: analyticsthreads: 4keepalives_idle: 0 # default 0, indicating the system defaultconnect_timeout: 10 # default 10 seconds# search_path: public # optional, not recommendedsslmode: [optional, set the sslmode used to connect to the database (in case this parameter is set, will look for ca in ~/.postgresql/root.crt)]ra3: true # enables cross-database sources
IAM Authentication
To set up a Redshift profile using IAM Authentication, set the method
parameter to iam
as shown below. Note that a password is not required when
using IAM Authentication. For more information on this type of authentication,
consult the Redshift Documentation
and boto3
docs
on generating user credentials with IAM Auth.
If you receive the "You must specify a region" error when using IAM
Authentication, then your aws credentials are likely misconfigured. Try running
aws configure
to set up AWS access keys, and pick a default region. If you have any questions,
please refer to the official AWS documentation on Configuration and credential file settings.
my-redshift-db:target: devoutputs:dev:type: redshiftmethod: iamcluster_id: [cluster_id]host: hostname.region.redshift.amazonaws.comuser: aliceiam_profile: data_engineer # optionaliam_duration_seconds: 900 # optionalautocreate: true # optionaldb_groups: ['analysts'] # optional# Other Redshift configs:port: 5439dbname: analyticsschema: analyticsthreads: 4keepalives_idle: 0 # default 0, indicating the system default# search_path: public # optional, but not recommendedsslmode: [optional, set the sslmode used to connect to the database (in case this parameter is set, will look for ca in ~/.postgresql/root.crt)]ra3: true # enables cross-database sources
Specifying an IAM Profile
New in dbt v0.18.0
The iam_profile
config option for Redshift profiles is new in dbt v0.18.0
When the iam_profile
configuration is set, dbt will use the specified profile from your ~/.aws/config
file instead of using the profile name default
Redshift notes
Where possible, dbt enables the use of sort
and dist
keys. See the section on Redshift specific configurations.