aws_ athena_ workgroup cost estimation
Serverless query engine for S3 data. $5 per TB scanned (standard). Provisioned capacity option starts at $0.30/DPU-hour with 24-hour minimum. Workgroups themselves are free; the queries within bill.
Amazon Athena queries data in S3 using SQL. The aws_
Two pricing models exist:
Standard (per-query): $5 per TB of data scanned. Data scanned is the amount Athena reads from S3 to satisfy the query, after partition pruning. A query over 100 GB scans costs $0.50.
Provisioned capacity: $0.30 per DPU-hour with a 24-hour minimum commitment. Useful for predictable, high-volume query workloads where the per-TB rate would be expensive. Break-even: roughly 14 TB scanned/day to make provisioned cheaper than standard.
Common cost surprises: - SELECT * scans every column. Use specific column lists to read less. - Unpartitioned data scans the entire table. Partition by date/region. - Text formats (CSV, JSON) scan more bytes than columnar (Parquet, ORC). Migrate hot tables to Parquet for 10-100x reduction. - Failed queries don't bill, but cancelled queries do (for data already scanned). - DML queries (INSERT, CTAS) bill both scan and write costs.
c3x estimates Athena based on declared workgroup configuration. For accurate cost, specify query volume (TB scanned/month) in c3x-usage.yml, Terraform doesn't know how much you'll query.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_athena_workgroup" "analytics" {
name = "analytics-team"
configuration {
enforce_workgroup_configuration = true
publish_cloudwatch_metrics_enabled = true
result_configuration {
output_location = "s3://athena-results-prod/output/"
encryption_configuration {
encryption_option = "SSE_S3"
}
}
bytes_scanned_cutoff_per_query = 10737418240 # 10 GB hard cap per query
}
}Pricing dimensions
What you actually pay for when you provision aws_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Data scanned (standard) | per TB | Amount of data Athena reads from S3 to satisfy queries. Pay-per-query model. $5/TB scanned |
| Provisioned capacity | per DPU-hour | Reserved capacity for predictable workloads. 24-hour minimum commitment. Break-even at ~14 TB/day. $0.30/DPU-hour |
| Federated query (Lambda) | per invocation | When queries span non-S3 sources via federated connectors, the underlying Lambda invocations bill separately. Standard Lambda pricing |
| Result storage (S3) | per GB-month | Query results are stored in S3 (configured per workgroup). Standard S3 pricing applies. $0.023/GB-month |
Optimization tips
Common ways to reduce aws_ cost without changing the workload.
Convert tables to Parquet
50-90% per queryParquet is columnar, so SELECT col1, col2 only reads col1/col2 bytes from S3. Typical reduction: 50-90% of bytes scanned vs CSV/JSON. Use AWS Glue or a one-off CTAS to convert.
Partition aggressively
10-1000x reductionPartition tables by frequently-filtered columns (date, region, customer_
Set bytes_ scanned_ cutoff_ per_ query
Prevents runaway costsPrevents accidental TB-scale queries. Set a 10 GB or 100 GB cap depending on workgroup purpose. Queries that would exceed the limit fail before billing.
Avoid SELECT *
30-90% per queryAthena scans every column referenced in the query. Listing specific columns reduces scan bytes proportionally. With Parquet, the reduction is substantial.
Consider provisioned capacity for steady high volume
20-40% on high-volume workloadsAbove ~14 TB scanned/day, provisioned capacity at $0.30/DPU-hour can be cheaper. Calculate exactly: scan TB/day × $5 vs DPU count × $0.30 × 24.
FAQ
Does the Athena workgroup itself cost money?
No. Workgroups are organizational containers, they cost nothing on their own. Queries running within the workgroup bill at the standard or provisioned rate.
Do failed queries bill?
Failed queries (syntax errors, schema mismatches) don't bill, they fail before scanning data. Cancelled queries DO bill for the data already scanned before cancellation. Queries that hit the bytes_
How does Athena pricing compare to Redshift Spectrum?
Both query S3 data and charge similar per-TB rates ($5/TB). Spectrum requires a Redshift cluster (additional cost) but offers tighter integration if you already have one. Athena is fully serverless.
Can I set a budget cap on Athena queries?
Per-query: yes, via bytes_
Related resources
More AWS resources
Further reading
- Athena partitioning cost savings: pay for less scanned data
Athena charges $5 per terabyte scanned, so the whole cost game is scanning less. Partitioning, columnar formats, and compression can cut the data a query reads by 10 to 100 times. Here is how each lever works and how they stack to slash an Athena bill.
- AWS Athena cost optimization: you pay per terabyte scanned
Athena charges $5 per TB of data scanned, so cost is decided by how much data each query reads, not how often you query. Partitioning, columnar formats, and compression cut scans by an order of magnitude. Here is how.
- AWS Glue cost optimization: DPU hours, crawlers, and the catalog
Glue bills about $0.44 per DPU-hour for jobs and crawlers, with a minimum billing per run, plus Data Catalog storage and request fees. Fewer, right-sized DPUs and less frequent crawling are the main levers. Here is the breakdown.
- AWS Glue crawler cost: the minimum charges that add up
Glue crawlers keep your Data Catalog in sync with S3, but they bill per DPU-hour with a 10-minute minimum and a 2-DPU floor, so frequent crawls of many tables cost more than teams expect. Here is the pricing and how to crawl less to spend less.
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_.