analyzing-release-read…
Trigger a pre-merge release readiness review on a GitHub PR, GitLab MR, or local branch. Use when the user wants to analyze code…
Queries S3 object metadata, tracks bucket activity, audits object changes, searches annotations, and analyzes storage metrics using S3 Metadata system tables (journal, inventory, annotation) and S3 Storage Lens tables via Athena SQL. Applies when counting objects, finding recent
Claude Code
$ npx -y skills add aws/agent-toolkit-for-aws --skill querying-aws-s3 --agent claude-code
Codex
$ npx skills add aws/agent-toolkit-for-aws --skill querying-aws-s3 -a codex -y
Cursor
$ npx skills add aws/agent-toolkit-for-aws --skill querying-aws-s3 -a cursor -y
Gemini CLI
$ npx skills add aws/agent-toolkit-for-aws --skill querying-aws-s3 -a gemini-cli -y
GitHub Copilot
$ npx skills add aws/agent-toolkit-for-aws --skill querying-aws-s3 -a github-copilot -y
OpenCode
$ npx skills add aws/agent-toolkit-for-aws --skill querying-aws-s3 -a opencode -y
Windsurf
$ npx skills add aws/agent-toolkit-for-aws --skill querying-aws-s3 -a windsurf -y
name: querying-aws-s3 description: >- Queries S3 object metadata, tracks bucket activity, audits object changes, searches annotations, and analyzes storage metrics using S3 Metadata system tables (journal, inventory, annotation) and S3 Storage Lens tables via Athena SQL. Applies when counting objects, finding recent uploads or deletions, identifying who wrote to a prefix, breaking down storage classes, finding objects by tag, searching annotation content, analyzing storage lens metrics, or enabling S3 Metadata tracking. Prefers system tables over raw S3 APIs (list-objects-v2, head-object) at scale. Trigger phrases: bucket activity, object count, who uploaded, track deletions, storage class breakdown, find by tag, search annotations, storage lens metrics, audit bucket changes. version: 1 argument-hint: "[bucket-name|query|'configure BUCKET'|'status BUCKET']"
**Works best with** the [AWS MCP server](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/getting-started-aws-mcp-server.html) for sandboxed execution and audit logging. All commands below use the AWS CLI and work in any environment with configured AWS credentials. Use IAM roles or temporary credentials; avoid long-lived access keys.
Amazon S3 Metadata provides continuously-updated Apache Iceberg tables that capture object-level metadata for general-purpose buckets. S3 Storage Lens exports aggregated storage and activity metrics as Iceberg tables. Both are read-only, stored in the AWS-managed `aws-s3` table bucket, and queryable via Amazon Athena.
System tables are preferred over raw S3 APIs (`list-objects-v2`, `head-object`) because:
| User intent | Use this skill? | Table | Alternative | |---|---|---|---| | How many objects in my bucket | **Yes** | inventory | — | | What was recently uploaded/deleted | **Yes** | journal | — | | Who wrote/deleted objects (audit) | **Yes** | journal (requester, source_ip) | — | | Storage class breakdown | **Yes** | inventory | — | | Find objects by tag or user metadata | **Yes** | inventory | — | | Search annotation content | **Yes** | annotation | Single object → direct API `get-object-annotation` | | Write/update an annotation | **No** | — | Direct API: `put-object-annotation` (tables are read-only) | | Query data *inside* objects | **No** | — | `querying-data-lake` | | Bucket-level storage metrics/trends | **Yes** | Storage Lens tables | — | | Enable metadata tracking | **Yes** | see Enable section | — |
Before querying, confirm S3 Metadata is enabled on the target bucket.
aws s3api get-bucket-metadata-configuration --bucket <BUCKET> --region <REGION>
**Interpret the response:**
**For Storage Lens:**
aws s3control get-storage-lens-configuration --account-id <ACCOUNT> --config-id <CONFIG_ID> --region <REGION>
Look for `DataExport.StorageLensTableDestination.IsEnabled: true`.
**Enable S3 Metadata on a bucket:**
aws s3api create-bucket-metadata-configuration \
--bucket <BUCKET> \
--region <REGION> \
--metadata-configuration '{
"JournalTableConfiguration": {"RecordExpiration": {"Expiration": "DISABLED"}},
"InventoryTableConfiguration": {"ConfigurationState": "ENABLED"}
}'To also enable annotations (requires a service role):
aws s3api create-bucket-metadata-configuration \
--bucket <BUCKET> \
--region <REGION> \
--metadata-configuration '{
"JournalTableConfiguration": {"RecordExpiration": {"Expiration": "ENABLED", "Days": 90}},
"InventoryTableConfiguration": {"ConfigurationState": "ENABLED"},
"AnnotationTableConfiguration": {"ConfigurationState": "ENABLED", "Role": "<ROLE_ARN>"}
}'**Enable Storage Lens S3 Tables export:**
aws s3control put-storage-lens-configuration \
--account-id <ACCOUNT> \
--config-id <CONFIG_ID> \
--region <REGION> \
--storage-lens-configuration '{
"Id": "<CONFIG_ID>",
"IsEnabled": true,
"AccountLevel": {"BucketLevel": {}},
"DataExport": {
"StorageLensTableDestination": {"IsEnabled": true}
}
}'**Register S3 Tables federated catalog in Glue** (required for Athena access):
aws glue create-catalog --region <REGION> --cli-input-json '{
"Name": "s3tablescatalog",
"CatalogInput": {
"FederatedCatalog": {
"Identifier": "arn:aws:s3tables:<REGION>:<ACCOUNT>:bucket/*",
"ConnectionName": "aws:s3tables"
}
}
}'For setup permissions and IAM role requirements, see [Security Considerations](#security-considerations) below.
Querying requires:
If `CATALOG_NOT_FOUND` errors occur, the Glue integration may not be enabled. See: [Integrating S3 Tables with AWS analytics services](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-integrating-aws.html)
*
Help AI coding agents build, deploy, and manage applications on AWS. The Agent Toolkit for AWS gives AI coding agents the tools, knowledge, and guardrails they need to work with AWS services.
Trigger a pre-merge release readiness review on a GitHub PR, GitLab MR, or local branch. Use when the user wants to analyze code…
Have a fast, conversational analysis with the AWS DevOps Agent. Use for cost optimization, architecture review, topology mapping,…
Coordinate the AWS DevOps Agent across multiple AgentSpaces from one Claude Code session — route questions to the right space…
Run a fast AWS Security Agent diff scan on only the changed code since a git ref. Use when the user asks to scan changes, run a…
Run a deep root-cause investigation on the AWS DevOps Agent. Use when the user describes an incident, alarm, outage, or…
Run an AWS Security Agent penetration test against a live web application — registers and verifies the target domain, exercises…
Use when running, building, or managing Linux containers on macOS, or when a task involves Docker, docker compose, Lima, Colima,…
Operate FrontendExtension (FE) resources in frontend-forge: create, update, rebuild, inspect package artifacts, download…
Build, debug, or review Cloudflare Agents SDK applications using the agents package.
Use when writing, reviewing, or debugging Terraform/OpenTofu modules, tests, CI, scans, or state ops - diagnoses failure mode…