Why it matters
Busy Athena users and dashboards write new results every day, so the results bucket grows steadily and is billed every month.How nOps finds it
nOps reads 90 days of S3 Standard storage for buckets named like Athena query-results buckets, in accounts that ran Athena queries in the last 30 days. A bucket is flagged when it grew by at least 5% over 90 days, never shrank by more than 3% on any day, and had no other storage class or lifecycle transition in the last 14 days. Everything stored 30 days ago is treated as results at least 30 days old, and must be at least 1 GB. The saving is that share of the bucket’s Standard storage cost, at your billed rate, and must be at least $5 a month.Before you start
Permission to update lifecycle rules (s3:GetLifecycleConfiguration, s3:PutLifecycleConfiguration).
How to implement
- Confirm the bucket only holds query results, and that no CTAS or UNLOAD output you need to keep is written there.
- Save the current lifecycle rules:
aws s3api get-bucket-lifecycle-configuration --bucket BUCKET. - Add a rule that expires objects after 30 days, scoped to the results prefix if the bucket holds anything else, and keep every existing rule (S3 → bucket → Management → Create lifecycle rule → Expire current versions of objects).
- If versioning is on, also expire noncurrent versions, or the old results stay billed.
- Update Terraform or CloudFormation with the same rule.
Risks and considerations
- Expired results are deleted permanently unless versioning is on.
- Athena query result reuse looks back a limited time, so results older than 30 days are rarely reused.
- The bucket is identified by its name, so check its contents before adding the rule.
- To roll back, remove the rule. Objects already expired cannot be recovered.