nerdexam
Amazon

SAP-C02 · Question #386

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…

The correct answer is B. Use a Lambda@Edge function that is invoked by an origin-response event. This solution will allow the detection logic to be run as soon as the image is uploaded to the S3 bucket, before it is served to users via the CloudFront distribution. This way, the detection logic can quickly identify any corrupted images and prevent them from being served to…

Submitted by fatima_kr· Mar 6, 2026Continuous Improvement for Existing Solutions

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?

Options

  • AUse a Lambda@Edge function that is invoked by a viewer-response event.
  • BUse a Lambda@Edge function that is invoked by an origin-response event.
  • CUse an S3 event notification that invokes an AWS Lambda function.
  • DUse an S3 event notification that invokes an AWS Step Functions state machine.

How the community answered

(27 responses)
  • A
    7% (2)
  • B
    59% (16)
  • C
    11% (3)
  • D
    22% (6)

Explanation

This solution will allow the detection logic to be run as soon as the image is uploaded to the S3 bucket, before it is served to users via the CloudFront distribution. This way, the detection logic can quickly identify any corrupted images and prevent them from being served to users, minimizing latency between ingestion and serving. https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html You can use Lambda@Edge to run your code in response to CloudFront events, such as a viewer request, an origin request, a response, or an error.

Community Discussion

No community discussion yet for this question.

Full SAP-C02 Practice