This article covers:
To create a new AWS Athena connection, navigate to the Connections page, select New Connection, and select the 'AWS Athena' connector. You'll be asked to provide values for the following properties:
s3://<bucket name>. You can access it by inspecting the details of your work group:

Notes:
AWS Athena only supports lowercase table and column names and only lowercase special characters (even though you can create these tables in AWS Glue). More information here: https://docs.aws.amazon.com/athena/latest/ug/tables-databases-columns-names.html
To ensure that e.g. only the Luzmo application can access your AWS Athena instance, it is highly recommended to whitelist Luzmo's range of static IP addresses. You should whitelist Luzmo's range of IP addresses as described here.
The connector requires the IAM user to have read-level authorization to access AWS Athena, AWS Glue and any of the sources (eg. S3 buckets or databases) queried. The user must also have read & write access to the S3 results bucket used. An example IAM Policy that gives this access is:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"athena:ListEngineVersions",
"athena:ListDataCatalogs",
"glue:GetTables",
"glue:GetPartitions",
"athena:ListWorkGroups",
"glue:GetDatabases",
"glue:GetTable"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"athena:GetTableMetadata",
"athena:StartQueryExecution",
"athena:GetQueryResultsStream",
"athena:GetQueryResults",
"s3:ListBucket",
"athena:GetDatabase",
"athena:GetDataCatalog",
"athena:GetNamedQuery",
"athena:GetPreparedStatement",
"athena:ListTagsForResource",
"athena:ListQueryExecutions",
"athena:ListNamedQueries",
"athena:GetWorkGroup",
"athena:ListDatabases",
"athena:StopQueryExecution",
"athena:GetQueryExecution",
"athena:BatchGetNamedQuery",
"athena:ListTableMetadata",
"athena:ListPreparedStatements",
"athena:BatchGetQueryExecution"
],
"Resource": [
"arn:aws:s3:::source-bucket",
"arn:aws:athena:*:457806912465:datacatalog/*",
"arn:aws:athena:*:457806912465:workgroup/primary"
]
},
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::source-bucket/*"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucketMultipartUploads",
"s3:AbortMultipartUpload",
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:ListMultipartUploadParts"
],
"Resource": [
"arn:aws:s3:::query-results-bucket/*",
"arn:aws:s3:::query-results-bucket"
]
}
]
}
Once you have connected your AWS Athena instance, you can add datasets as explained here. You can select one or multiple datasets as accessible in your Athena instance, and optionally link them in Luzmo to ensure they can be used together in a dashboard. Also make sure to check out this article on Preparing your data for analytics.
To find out how to add datasets using our API, please refer to this example in our developer documentation.
When generating an Authorization token to grant a user acces to your embedded dashboards it is possible to override the data source properties in the authorization request to dynamically use different properties. Find out more about connection overrides.
The fields available for overriding an AWS Athena connection are as follows:
s3://<bucket name>. You can access it by inspecting the details of your work group.Example code demonstrating how to override an AWS Athena connection:
import Luzmo from '@luzmo/nodejs-sdk';
const client = new Luzmo({
api_key: '<your Luzmo API key>',
api_token: '<your Luzmo API token>',
host: 'https://api.luzmo.com:443'
});
const response = await client.create('authorization',
{
type: "embed",
username: "< A unique and immutable identifier for your user >",
name: "< user name >",
email: "< user email >",
suborganization: "< a suborganization name >",
access: {
collections: [
{
id: "<collection_id>",
inheritRights: "use"
}
]
},
account_overrides: {
"<account_id>": {
"properties": {
"host": "<new_s3_results_bucket_endpoint>",
"key": "<new_IAM_access_id>",
"token": "<new_IAM_access_key>",
"region": "<new_Athena_region>",
"workgroup": "<new_Athena_workgroup>"
},
"datasets": {
"<dataset_id>": {
"schema": "<new_Athena_database>",
"table": "<new_Athena_table_or_view>"
}
}
}
}
);
| Data Type AWS Athena | Translated Data Type in Luzmo |
|---|---|
| tinyint | numeric |
| int | numeric |
| smallint | numeric |
| bigint | numeric |
| double | numeric |
| float | numeric |
| decimal | numeric |
| integer | numeric |
| real | numeric |
| boolean | hierarchy |
| string | hierarchy |
| char | hierarchy |
| varchar | hierarchy |
| date | datetime |
| timestamp | datetime |