querying-aws-s3

Queries S3 Metadata and Storage Lens system tables via Athena SQL for object auditing and storage analysis.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill querying-aws-s3-sakicodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: querying-aws-s3
Source: https://github.com/sakicodes/BuildFestHackathon26/tree/main/.agents/skills/querying-aws-s3
Command: npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill querying-aws-s3-sakicodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Listing millions of S3 objects with raw APIs like list-objects-v2 is slow and cannot answer audit questions such as who uploaded or deleted an object. This Skill queries S3 Metadata system tables (journal, inventory, annotation) and S3 Storage Lens tables through Amazon Athena, turning bucket-wide questions into fast SQL queries. ## Core Features & Use Cases - Bucket Auditing: Track recent uploads, deletions, and annotation events with requester and source IP details from the journal table. - Inventory Analysis: Count objects, break down storage classes, and find objects by tag or user metadata using the inventory table. - Annotation Search: Search annotation payloads with LIKE or json_extract_scalar across the annotation table. - Storage Lens Metrics: Analyze per-bucket storage distribution and GET/PUT/DELETE activity metrics. - Setup Guidance: Enable S3 Metadata configurations, register the S3 Tables federated catalog in Glue, and apply least-privilege IAM policies. - Use Case: A security engineer asks who deleted objects from a production bucket in the last 24 hours; the Skill runs a journal table query filtering record_type = 'DELETE' and returns keys, timestamps, requesters, and source IPs. ## Quick Start Ask the assistant to show all objects deleted from your S3 bucket in the last 24 hours, providing the bucket name and AWS region.

Frequently Asked Questions about querying-aws-s3

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find out who deleted objects from an S3 bucket?

Query the S3 Metadata journal table in Athena filtering record_type = 'DELETE' and a recent record_timestamp window. The journal table includes requester and source_ip_address columns that identify who performed the deletion, which raw S3 APIs cannot provide.

How to count objects in a large S3 bucket quickly?

Run SELECT COUNT(*) against the S3 Metadata inventory table in Athena instead of paginating list-objects-v2, which returns only 1000 objects per call. The inventory table holds one row per object and answers counts in seconds even for buckets with billions of objects.

When should I use Athena queries versus direct S3 APIs?

Use Athena on the system tables for aggregates, counts, and full-text searches across many objects. Use direct APIs like get-object-annotation for a single known object, and put-object-annotation for writes, since the system tables are read-only.

Why does my Athena query return CATALOG_NOT_FOUND for S3 tables?

CATALOG_NOT_FOUND means the S3 Tables federated catalog is not registered in AWS Glue. Enable the integration via the S3 console under Table buckets, or run aws glue create-catalog with the s3tablescatalog federated identifier for your region and account.

Why is the S3 inventory table empty after enabling metadata?

An empty inventory table usually means the configuration is still in BACKFILLING status. Check the table status with get-bucket-metadata-configuration and wait for it to reach ACTIVE, which can take minutes to hours depending on object count.

Can I update S3 object annotations through the system tables?

No, the S3 Metadata annotation table is read-only and does not support INSERT, UPDATE, or DELETE. To write or update an annotation, use the direct put-object-annotation API against the specific object.