AWS Redshift

AWS Redshift


If the cluster is configured within a VPC (opens in a new tab), then Cube must have a network route to the cluster.



Add the following to a .env file in your Cube project:


Cube Cloud

ℹ️Allowing connections from Cube Cloud IP

In some cases you'll need to allow connections from your Cube Cloud deployment IP address to your database. You can copy the IP address from either the Database Setup step in deployment creation, or from Settings → Configuration in your deployment.

The following fields are required when creating an AWS Redshift connection:

Cube Cloud AWS Redshift Configuration Screen

Cube Cloud also supports connecting to data sources within private VPCs. If you already have VPCs enabled in your account, check out the VPC documentation to learn how to get started.

VPC connectivity is available in Cube Cloud on Enterprise (opens in a new tab) tier. Contact us (opens in a new tab) for details.

Environment Variables

Environment VariableDescriptionPossible ValuesRequired
CUBEJS_DB_HOSTThe host URL for a databaseA valid database host URL
CUBEJS_DB_PORTThe port for the database connectionA valid port number
CUBEJS_DB_NAMEThe name of the database to connect toA valid database name
CUBEJS_DB_USERThe username used to connect to the databaseA valid database username
CUBEJS_DB_PASSThe password used to connect to the databaseA valid database password
CUBEJS_DB_SSLIf true, enables SSL encryption for database connections from Cubetrue, false
CUBEJS_CONCURRENCYThe number of concurrent connections each queue has to the database. Default is 4A valid number
CUBEJS_DB_MAX_POOLThe maximum number of concurrent database connections to pool. Default is 16A valid number

Pre-Aggregation Feature Support


Measures of type count_distinct_approx can not be used in pre-aggregations when using AWS Redshift as a source database.

Pre-Aggregation Build Strategies

To learn more about pre-aggregation build strategies, head here.

FeatureWorks with read-only mode?Is default?
Export Bucket

By default, AWS Redshift uses batching to build pre-aggregations.


Cube requires the Redshift user to have ownership of a schema in Redshift to support pre-aggregations. By default, the schema name is prod_pre_aggregations. It can be set using the pre_aggregations_schema configration option.

No extra configuration is required to configure batching for AWS Redshift.

Export bucket

AWS Redshift only supports using AWS S3 for export buckets.


For improved pre-aggregation performance with large datasets, enable export bucket functionality by configuring Cube with the following environment variables:

Ensure the AWS credentials are correctly configured in IAM to allow reads and writes to the export bucket in S3.



To enable SSL-encrypted connections between Cube and AWS Redshift, set the CUBEJS_DB_SSL environment variable to true. For more information on how to configure custom certificates, please check out Enable SSL Connections to the Database.