← All posts
2 min read

List and inspect S3 Inventory configurations

#aws#cli#s3#storage#operations
📑 On this page

Part 68 of AWS from Zero. This lesson keeps the scope to one S3 behavior you can verify from the terminal.

What we are learning

Inventory configurations have IDs, schedules, destinations, and enabled states. Audit all of them, not only the one you expect.

Before you run it

aws sts get-caller-identity
REGION="ap-south-1"
BUCKET="replace-with-your-private-demo-bucket"

Use a private general purpose bucket that you own. Replace every placeholder before running a write or delete command.

The command

aws s3api list-bucket-inventory-configurations \
  --bucket "$BUCKET"

A successful configuration command may return no output. Treat inspection as a separate required step.

Inspect the result

aws s3api list-bucket-inventory-configurations \
  --bucket "$BUCKET" \
  --query "InventoryConfigurationList[].{ID:Id,Enabled:IsEnabled,Versions:IncludedObjectVersions,Frequency:Schedule.Frequency,Destination:Destination.S3BucketDestination.Bucket}" \
  --output table

Read the returned fields rather than assuming the write succeeded exactly as intended.

One tiny variation

aws s3api get-bucket-inventory-configuration \
  --bucket "$BUCKET" \
  --id DailyCurrentVersions

Fetch one full configuration when you need optional fields and prefix filters.

Common mistake

An empty list does not mean the bucket lacks all reporting. CloudTrail data events, Storage Lens, metrics, and access logs are separate systems.

Cleanup

# This lesson does not require an additional persistent resource.
aws s3api head-bucket --bucket "$BUCKET"

Keep the shared demo bucket for the next lesson, or remove only the configuration and objects created here.

Next, we will learn Enable S3 request metrics for a bucket.

Official AWS CLI reference