Connecting to the Database

You can connect all Cube supported databases to your Cube Cloud deployment.

Cube Cloud Supported Databases Screen

Below you can find guides on how to use Cube Cloud with specific database vendors.

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

FieldDescriptionExamples
AWS Access Key IDThe AWS Access Key ID to use for database connectionsAKIAXXXXXXXXXXXXXXXX
AWS Secret Access KeyThe AWS Secret Access Key to use for database connectionsasd+/Ead123456asc23ASD2Acsf23/1A3fAc56af
AWS RegionThe AWS region of the Cube deploymentus-east-1
S3 Output LocationThe S3 path to store query results made by the Cube deployments3://my-output-bucket/outputs/
Cube Cloud AWS Athena Configuration Screen

Ensure that the database can be accessed over the public Internet. If you'd prefer to keep the database on a private network, contact us for VPC peering solutions.

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

FieldDescriptionExamples
HostnameThe host URL for the AWS Redshift clusterexamplecluster.abc123xyz789.us-west-2.redshift.amazonaws.com
PortThe port for the AWS Redshift cluster5439
DatabaseThe name of the database to connect topublic
UsernameThe username used to connect to the databaseredshift
PasswordThe password used to connect to the databaseMY_SUPER_SECRET_PASSWORD
Cube Cloud AWS Redshift Configuration Screen

The following fields are required when creating a BigQuery connection:

FieldDescriptionExamples
Service Account JSON fileA JSON key file for connecting to Google BigQueryA valid Google BigQuery JSON key file
Project IDThe Google BigQuery project ID to connect tomy-bigquery-project
Encoded Key FileA Base64 encoded JSON key file for connecting to Google BigQuery. Required if Service Account JSON file is not providedA valid Google BigQuery JSON key file encoded as a Base64 string
Cube Cloud BigQuery Configuration Screen

The following fields are required when creating a Snowflake connection:

FieldDescriptionExamples
UsernameThe username used to connect to the databasecube
PasswordThe password used to connect to the databaseMY_SUPER_SECRET_PASSWORD
DatabaseThe name of the database to connect toMY_SNOWFLAKE_DB
AccountThe Snowflake account ID to use when connecting to the databaseqna90001
RegionThe Snowflake region to use when connecting to the databaseus-east-1
WarehouseThe Snowflake warehouse to use when connecting to the databaseMY_WAREHOUSE
RoleThe Snowflake role to use when connecting to the databasePUBLIC
Cube Cloud Snowflake Configuration Screen

If you are connecting to multiple databases, set up the first database connection during the deployment creation wizard. First, make sure you have the correct configuration in your cube.js file according to your multitenancy setup. Next, configure the corresponding environment variables on the Settings - Env Vars page.

When setting up a new deployment, simply select the SSL checkbox when entering database credentials:

Cube Cloud Database Connection Screen

To use custom SSL certificates between Cube Cloud and your database server, go to the Env vars tab in Settings:

Depending on how SSL is configured on your database server, you may need to specify additional environment variables, please check the Environment Variables reference for more information.

Cube Cloud Database Connection Screen

Add the following environment variables:

Environment VariableDescriptionExample
CUBEJS_DB_SSLIf true, enables SSL encryption for database connections from Cubetrue, false
CUBEJS_DB_SSL_CAThe contents of a CA bundle in PEM format, or a path to one. For more information, check the options.ca property for TLS Secure Contexts in the Node.js documentationA valid CA bundle or a path to one
CUBEJS_DB_SSL_CERTThe contents of an SSL certificate in PEM format, or a path to one. For more information, check the options.cert property for TLS Secure Contexts in the Node.js documentationA valid SSL certificate or a path to one
CUBEJS_DB_SSL_KEYThe contents of a private key in PEM format, or a path to one. For more information, check the options.key property for TLS Secure Contexts in the Node.js documentationA valid SSL private key or a path to one

In some cases you'd 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 the Env Vars tab in your deployment Settings page.

Contact us for VPC peering and on-premise solutions.

Did you find this page useful?