All cheat sheets
Storagecheat sheet

S3 Inventory

A scheduled audit report of every object in a bucket — size, age, storage class, encryption status — delivered as queryable CSV/Parquet for ~$0.0025 per 1,000 objects. The foundation for cleanups, compliance answers, and Batch Operations manifests.

Last reviewed: July 11, 2026

TL;DR: S3 Inventory answers "what is actually in this bucket?" — a scheduled (daily/weekly) report of every object with size, last-modified, storage class, encryption status, and more, delivered as CSV or Parquet you can query with Athena. At $0.0025 per 1,000 objects it costs pennies, and it's the manifest source for Batch Operations. You can't optimize what you can't list.

The numbers

  • Cost: $0.0025 per 1,000 objects listed — a million-object bucket reports for $2.50
  • Field-tested finds from the source workflow: 12,000 orphaned profile pictures (objects with no DB row); 400+ duplicate log files found by matching ETags; an inherited 15-bucket estate cut from $140/month to $22 (~$1,400/year) after one inventory pass showed 11 buckets were dead weight
  • Compliance answer in a report: "97% encrypted, 3% not" — with the exact keys to fix

Do this

  1. Configure it on your biggest (or most mysterious) buckets: console → bucket → Management → Inventory configurations, or put-bucket-inventory-configuration. Choose Parquet if there's any chance you'll query it; include size, last-modified, storage class, encryption status, and (on versioned buckets) current-versions-only.

  2. Wait for the first report (up to 48 h daily / 7 days weekly), then point Athena at the destination and ask the questions that have been bothering you:

    SELECT key, size, last_modified_date FROM s3_inventory
    WHERE size > 104857600
      AND last_modified_date < date_add('year', -1, now())
    ORDER BY size DESC;
    

    Instant cleanup hit list: big, old, forgotten.

  3. Cross-reference against your app database for orphan detection — S3 keys with no corresponding row are pure waste.

  4. Feed the results into action: Batch Operations consumes inventory manifests directly for the one-time cleanup; lifecycle policies prevent re-accumulation. The mature loop is inventory → Athena filter → batch job → Slack report.

Gotchas

  • Don't point the destination inside the source scope — the next report inventories the previous reports, recursively.
  • Keep the destination in the same region (cross-region delivery bills transfer fees) and lock it down — inventory metadata (filenames, encryption flags) is sensitive.
  • Versioned buckets bloat reports unless you select current-versions-only.
  • Expire old reports with a lifecycle rule on the destination (90 days is plenty) — hoarding weekly reports from 2022 is its own little waste stream.
  • Reports are snapshots, not real-time — eventually consistent, on a schedule. Event-driven work belongs to S3 Notifications.

Skip this if

  • The bucket is small enough to eyeball in the console.
  • You only need aggregate metrics (total size, class distribution) — that's Storage Lens, no per-object listing needed. Lens spots the what; Inventory gets you the list.

Run this audit with your AI assistant

Paste this into Claude, ChatGPT, or any agent that can run the AWS CLI with read-only credentials. It audits your account for exactly the waste this sheet describes — and changes nothing.

You are auditing an AWS account's use of S3 Inventory and identifying
where it should be enabled. Use the AWS CLI with READ-ONLY credentials.
Do not create, modify, or delete anything — report findings and
recommended (unapplied) fixes only.

1. Which buckets have Inventory configured?
   aws s3api list-bucket-inventory-configurations --bucket <b>
   For configured ones: note fields captured, format (CSV vs Parquet),
   schedule, destination — and whether destination has a lifecycle rule
   expiring old reports (report hoarding is its own waste).
2. Which large buckets lack Inventory? Rank by CloudWatch
   BucketSizeBytes; recommend weekly Parquet inventory for the top
   buckets, prefix-filtered where only part of a bucket matters.
3. Sanity checks on configs: destination bucket must not be inside the
   source scope (recursive reports); destination should be same-region
   (cross-region delivery costs transfer fees); versioned buckets
   should usually report current versions only.
4. Cost estimate: $0.0025 per 1,000 objects listed per run.

Report: existing configs with issues flagged; recommended new configs
as put-bucket-inventory-configuration JSON ready for review — but do
NOT apply them; plus 3 example Athena queries the user should run on
the first report (oversized+stale objects, unencrypted objects,
storage-class distribution).
Works with any assistant that can run shell commands.

Want the guided version?

The S3 Inventory walkthrough covers this topic interactively — it asks about your setup, branches to what’s relevant, and quizzes you on the tricky parts. Free and anonymous.

Start the walkthrough