AWS Athena Setup Instructions
Prerequisites
- An AWS account with Athena enabled in your region
- A Glue Data Catalog database with tables pointing to S3 data
- An S3 bucket for Athena query results
- IAM credentials with Athena and S3 permissions
Step 1: Create an S3 Output Bucket
Athena requires an S3 location to store query results:
- Go to S3 in the AWS Console
- Create a bucket (e.g.
my-athena-results) - Note the full path:
s3://my-athena-results/vendo/
Step 2: Create an IAM Policy
Create a policy with the minimum required permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"athena:StartQueryExecution",
"athena:GetQueryExecution",
"athena:GetQueryResults",
"athena:StopQueryExecution"
],
"Resource": "arn:aws:athena:*:*:workgroup/primary"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-athena-results",
"arn:aws:s3:::my-athena-results/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-data-lake-bucket",
"arn:aws:s3:::my-data-lake-bucket/*"
]
},
{
"Effect": "Allow",
"Action": [
"glue:GetTable",
"glue:GetTables",
"glue:GetDatabase",
"glue:GetDatabases",
"glue:GetPartitions"
],
"Resource": "*"
}
]
}Replace bucket names with your actual S3 buckets.
Step 3: Create an IAM User
- Go to IAM > Users > Create user
- Attach the policy from Step 2
- Create an access key (programmatic access)
- Save the Access Key ID and Secret Access Key
Step 4: Configure in Vendo
- Go to Sources > Add Source > AWS Athena
- Enter your credentials:
| Field | Description |
|---|---|
| AWS Region | Region where Athena runs (e.g. us-east-1) |
| Database | Glue Data Catalog database name |
| S3 Output Location | S3 path for query results (e.g. s3://my-athena-results/vendo/) |
| Catalog | Data catalog name (optional, defaults to AwsDataCatalog) |
| Access Key ID | IAM user access key |
| Secret Access Key | IAM user secret key |
- Click Test Connection
- Once verified, click Save
Troubleshooting
Query Failed — Access Denied
- Verify IAM permissions include Athena, S3 (both data and results buckets), and Glue
- Check that the S3 output location bucket exists and is writable
- Ensure the IAM user has
s3:GetObjecton the source data bucket
Database Not Found
- Verify the Glue Data Catalog database name is correct
- Check that the database exists in the same region as your Athena configuration
- Run
SHOW DATABASESin the Athena console to list available databases
Slow Queries
- Athena scans data in S3 — use partitioned tables and columnar formats (Parquet, ORC) for best performance
- Queries against CSV or JSON data will scan more bytes and cost more
- Consider using Athena workgroups with query limits for cost control
Last updated on