AWS Certified Solutions Architect – Professional (SAP-C02) — Question 235
A company’s interactive web application uses an Amazon CloudFront distribution to serve images from an Amazon S3 bucket. Occasionally, third-party tools ingest corrupted images into the S3 bucket. This image corruption causes a poor user experience in the application later. The company has successfully implemented and tested Python logic to detect corrupt images.
A solutions architect must recommend a solution to integrate the detection logic with minimal latency between the ingestion and serving.
Which solution will meet these requirements?
Answer options
- A. Use a Lambda@Edge function that is invoked by a viewer-response event.
- B. Use a Lambda@Edge function that is invoked by an origin-response event.
- C. Use an S3 event notification that invokes an AWS Lambda function.
- D. Use an S3 event notification that invokes an AWS Step Functions state machine.
Correct answer: C
Explanation
The correct answer is C because using an S3 event notification to trigger an AWS Lambda function allows for immediate processing of uploaded images as soon as they hit the S3 bucket, ensuring minimal latency. In contrast, options A and B involve Lambda@Edge, which works at the edge locations and may not address image corruption until after the images are requested, thus introducing unnecessary delays. Option D adds complexity by involving AWS Step Functions, which is not needed for this straightforward image validation process.