DVA-C02 · Question #559
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 correct answer is D. Use the sam local generate-event command to create test payloads for local testing.. Using the sam local generate-event command is the best solution because the sam local generate-event command automatically generates event payloads that match the structure of real AWS service events. It simplifies testing by providing predefined events for a variety of AWS servi
Question
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?
Options
- ACreate shareable test Lambda events. Use these test Lambda events for local testing.
- BStore manually created test event payloads locally. Use the sam local invoke command with the
- CStore manually created test event payloads in an Amazon S3 bucket. Use the sam local invoke
- DUse the sam local generate-event command to create test payloads for local testing.
How the community answered
(49 responses)- A6% (3)
- B2% (1)
- C2% (1)
- D90% (44)
Explanation
Using the sam local generate-event command is the best solution because the sam local generate-event command automatically generates event payloads that match the structure of real AWS service events. It simplifies testing by providing predefined events for a variety of AWS services and does not require the developer to manually create or store test payloads. This solution requires the least development effort and matches the requirement to test Lambda functions locally with accurate event payloads.
Community Discussion
No community discussion yet for this question.