AWS Certified Developer – Associate — Question 356

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 SAM CLI provides native capabilities to simulate AWS services locally using commands like 'sam local generate-event' and 'sam local invoke', making it the most efficient way to test Lambda functions locally. Options A and D are incorrect because cloud-based S3 buckets and the AWS Management Console cannot directly interact with or trigger a Lambda function running on a local machine. Option B is incorrect because the 'aws lambda invoke' command is used to trigger functions already deployed to the AWS cloud, not for local execution.