- A set of IAM credentials which allow access to AWS Athena
- The AWS region
- The S3 bucket on AWS to store query results
Add the following to a
.env file in your Cube project:
CUBEJS_DB_TYPE=athena CUBEJS_AWS_KEY=AKIA************ CUBEJS_AWS_SECRET=**************************************** CUBEJS_AWS_REGION=us-east-1 CUBEJS_AWS_S3_OUTPUT_LOCATION=s3://my-athena-output-bucket CUBEJS_AWS_ATHENA_WORKGROUP=primary CUBEJS_AWS_ATHENA_CATALOG=AwsDataCatalog
|Environment Variable||Description||Possible Values||Required||Supports multiple data sources?|
|The AWS Access Key ID to use for database connections||A valid AWS Access Key ID||✅||✅|
|The AWS Secret Access Key to use for database connections||A valid AWS Secret Access Key||✅||✅|
|The AWS region of the Cube deployment||A valid AWS region||✅||✅|
|The S3 path to store query results made by the Cube deployment||A valid S3 path||❌||✅|
|The name of the workgroup in which the query is being started||A valid Athena Workgroup||❌||✅|
|The name of the catalog to use by default||A valid Athena Catalog name||❌||✅|
|The name of the schema to use as ||A valid schema name||❌||✅|
|The number of concurrent connections each queue has to the database. Default is ||A valid number||❌||❌|
Measures of type
countDistinctApprox can be
used in pre-aggregations when using AWS Athena as a source database. To learn
more about AWS Athena's support for approximate aggregate functions, click
To learn more about pre-aggregation build strategies, head here.
|Feature||Works with read-only mode?||Is default?|
By default, AWS Athena uses a batching strategy to build pre-aggregations.
No extra configuration is required to configure batching for AWS Athena.
AWS Athena 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.
CUBEJS_DB_EXPORT_BUCKET_TYPE=s3 CUBEJS_DB_EXPORT_BUCKET=my.bucket.on.s3 CUBEJS_DB_EXPORT_BUCKET_AWS_KEY=<AWS_KEY> CUBEJS_DB_EXPORT_BUCKET_AWS_SECRET=<AWS_SECRET> CUBEJS_DB_EXPORT_BUCKET_AWS_REGION=<AWS_REGION>
Cube does not require any additional configuration to enable SSL as AWS Athena connections are made over HTTPS.
Did you find this page useful?