An e-commerce company wants a Lambda function to run automatically every time a new object is uploaded to a specific prefix in an S3 bucket, so it can generate a thumbnail. Which S3 feature triggers this without the application having to poll the bucket?
- S3 Storage Class Analysis
- S3 Event Notifications configured to invoke the Lambda function on PutObject events for that prefix
- S3 Requester Pays
- S3 Batch Operations run manually by an administrator
Why B? And why not the others?
Correct answer: B. S3 Event Notifications configured to invoke the Lambda function on PutObject events for that prefix
S3 Event Notifications let a bucket automatically publish an event to a destination such as an AWS Lambda function, Amazon SQS queue, or Amazon SNS topic whenever a specified action, such as a PutObject upload matching a prefix, occurs. That is precisely the automatic, push-based trigger the thumbnail generator needs, with no polling required. Storage Class Analysis only observes access patterns over time to help decide when objects should move to a cheaper storage class; it has no mechanism to invoke Lambda on upload. Requester Pays only changes who is billed for requests and data transfer against a bucket and has nothing to do with triggering compute. Running S3 Batch Operations manually is a one-time, administrator-initiated bulk action against a manifest of existing objects, not an automatic reaction to each new upload as it happens.
Source: AWS S3 docs: Amazon S3 Event Notifications