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

A developer is implementing an AWS Lambda function that will be invoked when an object is uploaded to Amazon S3. The developer wants to test the Lambda function in a local development machine before publishing the function to a production AWS account.

Which solution will meet these requirements with the LEAST operational overhead?

Answer options

Correct answer: C

Explanation

The AWS Serverless Application Model (AWS SAM) CLI provides the sam local suite of commands, which are specifically built to generate mock event payloads and execute Lambda functions locally in a Docker container. Using sam local generate-event s3 put and sam local invoke allows the developer to test S3 integrations entirely on their local machine with minimal setup. Other methods either require deploying resources to AWS, using commands like aws lambda invoke which only target the cloud service, or attempting to connect the AWS Management Console directly to a local development machine, which is not natively supported.