Q67 — AWS DVA-C02 Ch.3

Question 67 of 100 | ← Chapter 3

A developer is implementing an AWS Lambda function that is invoked when objects are uploaded to Amazon S3. The developer wants to test the Lambda function locally on their development machine before deploying the function to a production AWS account. Which solution meets these requirements with the least operational overhead?

Correct Answer: C. Use the sam local start-lambda CLI command to start Lambda locally. Use the sam local generate-event s3 put CLI command to create a Lambda test JSON file. Invoke the Lambda function using the sam local invoke CLI command, passing the JSON file as a parameter.

Explanation

Option C uses the SAM CLI tools to start a local Lambda runtime environment and generate a test JSON file for an S3 PutObject event using sam local generate-event s3 put. Then, it invokes the Lambda function locally using sam local invoke, enabling testing of Lambda behavior without deploying to AWS. Thus, Option C is the solution with the least operational overhead that satisfies the requirements. 【Lantern Certification: swufelp1999】