Inspect S3 event notification configuration
📑 On this page
Part 71 of AWS from Zero. This lesson keeps the scope to one S3 behavior you can verify from the terminal.
What we are learning
Bucket notification configuration is one document containing several destination types. Reading it first prevents accidental replacement.
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 get-bucket-notification-configuration \
--bucket "$BUCKET"A successful configuration command may return no output. Treat inspection as a separate required step.
Inspect the result
aws s3api get-bucket-notification-configuration \
--bucket "$BUCKET" \
--query "{Lambda:LambdaFunctionConfigurations,SQS:QueueConfigurations,SNS:TopicConfigurations,EventBridge:EventBridgeConfiguration}"Read the returned fields rather than assuming the write succeeded exactly as intended.
One tiny variation
aws s3api put-bucket-notification-configuration \
--bucket "$BUCKET" \
--notification-configuration '{}'An empty configuration removes bucket notifications. Use this only on a disposable bucket.
Common mistake
put-bucket-notification-configuration replaces the complete configuration. Preserve every destination that must remain.
Cleanup
aws s3api get-bucket-notification-configuration --bucket "$BUCKET"This lesson is read-only unless you intentionally used the empty configuration on a disposable bucket.
Next, we will learn Prepare S3 buckets for replication.