SOA-C03 practice question 10 of 10
A company runs a website on Amazon EC2 instances. Users can upload images to an Amazon S3 bucket and publish the images to the website. The company…
Full set: 219 questionsDomain Deployment, Provisioning, and Automation
The most direct and efficient method to meet the requirement is to use Amazon S3 Event Notifications. This feature is designed to enable event-driven computing by sending a notification to a destination when a specific event, such as an object creation (s3:ObjectCreated:), occurs in an S3 bucket. AWS Lambda is a natively supported destination for these notifications. Configuring an S3 event notification to target the Lambda function creates a direct, serverless invocation pattern without unnecessary intermediate services, providing a low-latency and cost-effective solution.
A. This is a valid but indirect pattern. It introduces an unnecessary component (SNS), adding latency and complexity compared to the direct S3-to-Lambda invocation.
B. Amazon CloudWatch Alarms are used to trigger actions based on metrics crossing a defined threshold, not for discrete events like an object upload.
D. This is also a valid but indirect pattern. While useful for decoupling and throttling, adding an SQS queue is not required for the simple invocation described. ---
1. AWS Lambda Developer Guide: In the section "Using AWS Lambda with Amazon S3," the documentation states, "You can use Amazon S3 to trigger a Lambda function to process object-created events. You can configure the S3 trigger in the Lambda console to create an S3 event notification that invokes your function." This confirms the direct integration. (Source: AWS Lambda Developer Guide, "Using AWS Lambda with Amazon S3").
2. Amazon S3 User Guide: The documentation on "Amazon S3 Event Notifications" lists the supported destinations for events. It explicitly includes "AWS Lambda function" as a destination. This highlights that a direct invocation is the intended design pattern. (Source: Amazon S3 User Guide, "Amazon S3 Event Notifications," section "Event notification destinations").
3. Amazon S3 User Guide: The guide further details the process in "Walkthrough: Using an S3 trigger to invoke a Lambda function." This walkthrough provides a step-by-step implementation of the exact scenario described in the question, reinforcing that S3 Event Notifications are the correct mechanism. (Source: Amazon S3 User Guide, "Tutorials and examples," section "Walkthrough: Using an S3 trigger to invoke a Lambda function").
4. Amazon CloudWatch User Guide: The documentation for "Using Amazon CloudWatch alarms" specifies that "You can create an alarm that watches a single CloudWatch metric... The alarm performs one or more actions based on the value of the metric... relative to a threshold over a number of time periods." This confirms alarms are for metric-based state changes, not event-based triggers. (Source: Amazon CloudWatch User Guide, "Using Amazon CloudWatch alarms").
Question breakdown
Key idea: S3 Event Notifications can invoke a Lambda function directly on object-created events, with no intermediary service required.
How to reach the answer
- The trigger is an object upload to an S3 bucket.
- S3 Event Notifications support Lambda as a native destination for s3:ObjectCreated events.
- SNS or SQS would only help if fan-out or buffering were required, and neither is mentioned.
- CloudWatch alarms respond to metric thresholds, not individual object events.
Each option
Common trap: SNS and SQS are familiar decoupling services, so they seem necessary, but S3 can call Lambda directly.
In practice: Thumbnail generation, file validation and metadata extraction pipelines are commonly built on S3 notifications that trigger Lambda, optionally filtered by prefix or suffix.
Remember: For 'run code when an object is uploaded', configure an S3 Event Notification with Lambda as the destination.
Official documentation: Process Amazon S3 event notifications with Lambda · Amazon S3 Event Notifications
Reviewed by David Mercer.
Keep practicing
Take the free SOA-C03 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SOA-C03 practice questions
- Question 1Optimization] A CloudOps engineer is using AWS Compute Optimizer to generate recommendati…
- Question 2A company's developers manually install software modules on Amazon EC2 instances to deplo…
- Question 3A company requires the rotation of administrative credentials for production workloads on…
- Question 4Application A runs on Amazon EC2 instances behind a Network Load Balancer (NLB). The EC2 …
- Question 5A company uses an organization in AWS Organizations to manage multiple AWS accounts. The …
- Question 6A global gaming company is preparing to launch a new game on AWS. The game runs in multip…
