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

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:
Field | Description | Examples |
---|---|---|
AWS Access Key ID | The AWS Access Key ID to use for database connections | AKIAXXXXXXXXXXXXXXXX |
AWS Secret Access Key | The AWS Secret Access Key to use for database connections | asd+/Ead123456asc23ASD2Acsf23/1A3fAc56af |
AWS Region | The AWS region of the Cube deployment | us-east-1 |
S3 Output Location | The S3 path to store query results made by the Cube deployment | s3://my-output-bucket/outputs/ |

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:
Field | Description | Examples |
---|---|---|
Hostname | The host URL for the AWS Redshift cluster | examplecluster.abc123xyz789.us-west-2.redshift.amazonaws.com |
Port | The port for the AWS Redshift cluster | 5439 |
Database | The name of the database to connect to | public |
Username | The username used to connect to the database | redshift |
Password | The password used to connect to the database | MY_SUPER_SECRET_PASSWORD |

The following fields are required when creating a BigQuery connection:
Field | Description | Examples |
---|---|---|
Service Account JSON file | A JSON key file for connecting to Google BigQuery | A valid Google BigQuery JSON key file |
Project ID | The Google BigQuery project ID to connect to | my-bigquery-project |
Encoded Key File | A Base64 encoded JSON key file for connecting to Google BigQuery. Required if Service Account JSON file is not provided | A valid Google BigQuery JSON key file encoded as a Base64 string |

The following fields are required when creating a Snowflake connection:
Field | Description | Examples |
---|---|---|
Username | The username used to connect to the database | cube |
Password | The password used to connect to the database | MY_SUPER_SECRET_PASSWORD |
Database | The name of the database to connect to | MY_SNOWFLAKE_DB |
Account | The Snowflake account ID to use when connecting to the database | qna90001 |
Region | The Snowflake region to use when connecting to the database | us-east-1 |
Warehouse | The Snowflake warehouse to use when connecting to the database | MY_WAREHOUSE |
Role | The Snowflake role to use when connecting to the database | PUBLIC |

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:

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.

Add the following environment variables:
Environment Variable | Description | Example |
---|---|---|
CUBEJS_DB_SSL | If true , enables SSL encryption for database connections from Cube | true , false |
CUBEJS_DB_SSL_CA | The 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 documentation | A valid CA bundle or a path to one |
CUBEJS_DB_SSL_CERT | The 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 documentation | A valid SSL certificate or a path to one |
CUBEJS_DB_SSL_KEY | The 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 documentation | A 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?