Explore your understanding of configuring S3 event notifications with Lambda functions, SNS topics, and SQS queues. This quiz covers key concepts, event types, supported destinations, and typical scenarios for integrating S3 event triggers with messaging and compute services.
Which of the following services can directly receive event notifications from S3 for object creation events?
Explanation: S3 can directly send event notifications to Lambda functions, enabling users to process files automatically as they are uploaded. Auto Scaling groups and CloudFront distributions are not valid direct notification targets for S3 events. IAM roles are used for permissions but cannot themselves receive S3 event notifications.
If you want to trigger a notification every time a file is permanently deleted from a bucket, which S3 event type should you use?
Explanation: The event type 's3:ObjectRemoved:Delete' captures permanent deletions of objects from the bucket. 's3:ObjectCreated:Put' relates to object uploads, while 's3:ObjectRestore:Post' is triggered during restoration from archives. 's3:ObjectAccessed:Get' is not a supported S3 event type.
You want to notify multiple subscribers whenever an object is added to your S3 bucket. Which destination allows easy fan-out to multiple endpoints?
Explanation: SNS topics are designed to fan out messages to multiple endpoints, such as email, HTTP, or other queues. A Lambda function is best for processing individual events but does not provide built-in fan-out to multiple subscribers. IAM policies control permissions but do not receive notifications, and EC2 instances cannot directly receive S3 event notifications.
When using an SQS queue as a destination for S3 events, what is a key benefit for processing notifications?
Explanation: An SQS queue helps decouple the source of events (S3) from the event consumers by storing messages until they are processed. Automatic object replication is not a built-in feature of SQS queues. Real-time analytics and direct file transfers are unrelated to the queueing functionality provided by SQS.
How can you ensure a Lambda function is only triggered by S3 events for files with .jpg extensions?
Explanation: Event notification filters, such as suffix filters for '.jpg', allow S3 to trigger notifications only when object keys match specific patterns. IAM policies control who can take actions but do not filter events. Retention policies manage object lifecycles, and the bucket region is unrelated to event filtering.
Which statement best describes the reliability of S3 event notification delivery to SQS queues and SNS topics?
Explanation: S3 event notifications to SQS and SNS are delivered at least once, which means messages might be delivered more than one time. S3 does not guarantee exactly-once delivery, and notification delivery is not dependent on object size. S3 does support notifications to both SQS and SNS.
Where do you configure S3 event notifications to trigger an SNS topic when a new object is uploaded?
Explanation: S3 event notifications are configured in the properties section of the S3 bucket settings. SQS queue settings and IAM role descriptions are unrelated to configuring S3 event notifications. Object metadata does not contain notification configuration options.
Which of the following cannot directly receive S3 event notifications as a destination?
Explanation: Database tables are not valid direct destinations for S3 event notifications. In contrast, Lambda functions, SQS queues, and SNS topics are supported destinations. Database tables may receive event data indirectly if processed by an application, but cannot be selected directly in the S3 configuration.
Is it possible to send the same S3 event notification to both a Lambda function and an SQS queue?
Explanation: S3 allows multiple notification configurations per bucket, so the same event can trigger different destinations like Lambda and SQS. The claim that only one destination is supported is incorrect. Third-party tools are unnecessary for this feature, and it is not limited specifically to delete events.
What permission must be granted for S3 to successfully invoke a Lambda function on an event?
Explanation: S3 needs permission to invoke the Lambda function, typically requiring the 'InvokeFunction' action for the bucket. 'ReadObject' allows reading of objects, but does not allow Lambda invocation. 'PutBucketNotification' allows editing notification configurations rather than executing them. 'GrantAll' is not a valid permission action.