AWS Certified Solutions Architect – Associate (SAA-C03) — Question 856
A company has an application that customers use to upload images to an Amazon S3 bucket. Each night, the company launches an Amazon EC2 Spot Fleet that processes all the images that the company received that day. The processing for each image takes 2 minutes and requires 512 MB of memory.
A solutions architect needs to change the application to process the images when the images are uploaded.
Which change will meet these requirements MOST cost-effectively?
Answer options
- A. Use S3 Event Notifications to write a message with image details to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an AWS Lambda function to read the messages from the queue and to process the images.
- B. Use S3 Event Notifications to write a message with image details to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an EC2 Reserved Instance to read the messages from the queue and to process the images.
- C. Use S3 Event Notifications to publish a message with image details to an Amazon Simple Notification Service (Amazon SNS) topic. Configure a container instance in Amazon Elastic Container Service (Amazon ECS) to subscribe to the topic and to process the images.
- D. Use S3 Event Notifications to publish a message with image details to an Amazon Simple Notification Service (Amazon SNS) topic. Configure an AWS Elastic Beanstalk application to subscribe to the topic and to process the images.
Correct answer: A
Explanation
AWS Lambda is the most cost-effective solution because it charges only for the exact duration of execution and the number of requests, aligning perfectly with the 2-minute processing time and 512 MB memory requirement per image. Using Amazon SQS acts as a buffer to handle spikes in image uploads and ensures reliable message delivery to Lambda. Other options involving EC2 Reserved Instances, ECS, or Elastic Beanstalk require provisioning continuously running infrastructure, which incurs higher costs during periods of low activity.