AWS Certified Developer – Associate (DVA-C02) — Question 527

A company is using the AWS Serverless Application Model (AWS SAM) to develop a social media application. A developer needs a quick way to test AWS Lambda functions locally by using test event payloads. The developer needs the structure of these test event payloads to match the actual events that AWS services create.

Which solution will meet these requirements with the LEAST development effort?

Answer options

Correct answer: D

Explanation

The sam local generate-event command is the most efficient way to generate realistic mock payloads for various AWS services without manual creation, satisfying the requirement for least development effort. Options B and C require manual payload creation, which increases effort and risk of structural mismatch. Option A relies on shareable test events but still requires manual creation or setup compared to the built-in CLI generator.