S3 + Athena Analytics (no-warehouse)
AWS architecture template · Athena queries S3 directly at $5/TB scanned — no cluster to provision. 10–100× cheaper than Redshift for infrequent or ad-hoc analytics workloads.
S3 + Athena Analytics (no-warehouse) is a free AWS architecture template built with S3, Athena, CloudWatch, IAM and Kinesis. Open it in TheArchitect to edit the diagram, estimate monthly cost, and export the CloudFormation or Terraform that deploys it.
AWS services in this template
- S3×2
- Athena
- CloudWatch
- IAM
- Kinesis
Deployment notes
Deploy-ready
- Use Parquet/ORC format and partition data by date/region to minimise data scanned (and cost).
- Athena charges per TB scanned — unpartitioned CSV on large datasets can be expensive. Convert to Parquet first.
- Cost comparison: Redshift dc2.large ~$180/mo always-on. Athena: $5/TB scanned — often <$5/mo for infrequent queries.
Generated CloudFormation — 6 resources
| Logical ID | Resource type |
|---|---|
| KinesisIngestkinesis | AWS::Kinesis::Stream |
| S3DataLakeraws3 | AWS::S3::Bucket |
| S3CuratedZones3 | AWS::S3::Bucket |
| AthenaserverlessSQLathena | AWS::Athena::WorkGroup |
| AthenaRoleiam | AWS::IAM::Role |
| ScanCostAlarmcloudwatch | AWS::CloudWatch::Alarm |
View the full CloudFormation template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Generated by TheArchitect — https://www.thecloudarchitect.dev",
"Metadata": {
"TheArchitect": {
"Edges": [
{
"From": "S3DataLakeraws3",
"To": "AthenaserverlessSQLathena",
"Label": "query source"
},
{
"From": "AthenaserverlessSQLathena",
"To": "S3CuratedZones3",
"Label": "results + CTAS"
},
{
"From": "AthenaRoleiam",
"To": "AthenaserverlessSQLathena",
"Label": "query role"
}
]
}
},
"Resources": {
"KinesisIngestkinesis": {
"Type": "AWS::Kinesis::Stream",
"Properties": {
"StreamModeDetails": {
"StreamMode": "PROVISIONED"
},
"ShardCount": 1
}
},
"S3DataLakeraws3": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "cost-analytics-raw",
"VersioningConfiguration": {
"Status": "Suspended"
},
"BucketEncryption": {
"ServerSideEncryptionConfiguration": [
{
"ServerSideEncryptionByDefault": {
"SSEAlgorithm": "AES256"
}
}
]
},
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"BlockPublicPolicy": true,
"IgnorePublicAcls": true,
"RestrictPublicBuckets": true
}
}
},
"S3CuratedZones3": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "cost-analytics-curated",
"BucketEncryption": {
"ServerSideEncryptionConfiguration": [
{
"ServerSideEncryptionByDefault": {
"SSEAlgorithm": "AES256"
}
}
]
},
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"BlockPublicPolicy": true,
"IgnorePublicAcls": true,
"RestrictPublicBuckets": true
}
}
},
"AthenaserverlessSQLathena": {
"Type": "AWS::Athena::WorkGroup",
"DependsOn": [
"AthenaRoleiam"
],
"Properties": {
"Name": "cost-analytics-wg",
"Description": "Athena workgroup — enforces per-query data scan limits and saves results to curated S3.",
"WorkGroupConfiguration": {
"EnforceWorkGroupConfiguration": true,
"PublishCloudWatchMetricsEnabled": true,
"BytesScannedCutoffPerQuery": 10737418240,
"ResultConfiguration": {
"OutputLocation": "s3://cost-analytics-curated/athena-results/"
}
}
}
},
"AthenaRoleiam": {
"Type": "AWS::IAM::Role",
"Properties": {
"RoleName": "cost-analytics-athena-role",
"Description": "Athena query execution role — S3 read on raw + write on curated, Glue Data Catalog read",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "athena.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
}
},
"ScanCostAlarmcloudwatch": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmName": "cost-athena-scan-spike",
"AlarmDescription": "Alert when total data scanned per day exceeds 100 GB — unexpected cost spike",
"Namespace": "AWS/Athena",
"MetricName": "DataScannedInBytes",
"Statistic": "Sum",
"Period": 86400,
"EvaluationPeriods": 1,
"Threshold": 107374182400,
"ComparisonOperator": "GreaterThanThreshold",
"TreatMissingData": "notBreaching"
}
}
}
}Generated by TheArchitect from the diagram above. Review values such as names, CIDR ranges and instance sizes before deploying to your account.
Related templates
- Redshift Data WarehouseSAA-C03: Kinesis → Lambda ETL → S3 staging → Redshift + Athena federated query
- IoT Fleet Telemetry PipelineKinesis stream ingests device telemetry with three parallel Lambda consumers: anomaly detection, device shadow updates, and cold-path S3 archival for Athena analytics.
- ML Inference + Feature StoreServerless ML serving with a dual feature store: Redis for low-latency online features and S3 for offline training set assembly via Athena.