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 a Snowflake connection:

Cube Cloud Snowflake 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_SNOWFLAKE_ACCOUNTThe Snowflake account identifier to use when connecting to the databaseA valid Snowflake account ID (opens in a new tab)
CUBEJS_DB_SNOWFLAKE_REGIONThe Snowflake region to use when connecting to the databaseA valid Snowflake region (opens in a new tab)
CUBEJS_DB_SNOWFLAKE_WAREHOUSEThe Snowflake warehouse to use when connecting to the databaseA valid Snowflake warehouse (opens in a new tab) in the account
CUBEJS_DB_SNOWFLAKE_ROLEThe Snowflake role to use when connecting to the databaseA valid Snowflake role (opens in a new tab) in the account
CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVEIf true, keep the Snowflake connection alive indefinitely (opens in a new tab)true, false
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_SNOWFLAKE_AUTHENTICATORThe type of authenticator to use with Snowflake. Use SNOWFLAKE with username/password, or SNOWFLAKE_JWT with key pairs. Defaults to SNOWFLAKESNOWFLAKE, SNOWFLAKE_JWT
CUBEJS_DB_SNOWFLAKE_PRIVATE_KEY_PATHThe path to the private RSA key folderA valid path to the private RSA key
CUBEJS_DB_SNOWFLAKE_PRIVATE_KEY_PASSThe password for the private RSA key. Only required for encrypted keysA valid password for the encrypted private RSA key
CUBEJS_CONCURRENCYThe number of concurrent connections each queue has to the database. Default is 5A valid number
CUBEJS_DB_MAX_POOLThe maximum number of concurrent database connections to pool. Default is 20A valid number

Pre-Aggregation Feature Support


Measures of type count_distinct_approx can be used in pre-aggregations when using Snowflake as a source database. To learn more about Snowflake's support for approximate aggregate functions, click here (opens in a new tab).

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, Snowflake uses batching to build pre-aggregations.


No extra configuration is required to configure batching for Snowflake.

Export Bucket

Snowflake supports using both AWS S3 (opens in a new tab) and Google Cloud Storage (opens in a new tab) for export bucket functionality.


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


Google Cloud Storage

When using an export bucket, remember to assign the Storage Object Admin role to your Google Cloud credentials (CUBEJS_DB_EXPORT_GCS_CREDENTIALS).

Before configuring Cube, an integration must be created and configured in Snowflake (opens in a new tab). Take note of the integration name (gcs_int from the example link) as you'll need it to configure Cube.

Once the Snowflake integration is set up, configure Cube using the following:



Cube does not require any additional configuration to enable SSL as Snowflake connections are made over HTTPS.