Learn how to automate image corruption detection in your web application using Amazon S3 event notifications and AWS Lambda. Ensure high-quality user experience by preventing the serving of corrupt images.
Table of Contents
Question
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?
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.
Answer
C. Use an S3 event notification that invokes an AWS Lambda function.
Explanation
This solution meets the requirements because it allows the company to integrate their existing Python logic for detecting corrupt images with minimal latency. When a new image is ingested into the S3 bucket, an S3 event notification can automatically trigger an AWS Lambda function.
This function can then execute the Python logic to check the image for corruption. If the image is found to be corrupt, the Lambda function can take appropriate action, such as deleting the image or moving it to a different location for further analysis. This process occurs almost instantaneously, ensuring minimal latency between the ingestion of the image and its serving to the application.
Amazon AWS Certified Solutions Architect – Professional SAP-C02 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified Solutions Architect – Professional SAP-C02 exam and earn Amazon AWS Certified Solutions Architect – Professional SAP-C02 certification.