
Answer-first summary for fast verification
Answer: Sam local start-api - Starts a local API Gateway for API testing.
The correct answer is D. The AWS SAM CLI 'sam local start-api' subcommand is used to start a local API Gateway instance, enabling you to test your REST API locally before deploying it to the production environment. The other subcommands do not meet this requirement: 'sam local invoke' is used to invoke a Lambda function locally, 'sam local generate-event' generates a local event for Lambda function invocation, and 'sam local start-lambda' starts a local instance of a Lambda function.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Which AWS SAM CLI subcommand enables local testing of a REST API developed with Amazon API Gateway and AWS Lambda?
A
Sam local invoke - Invokes a Lambda function locally.
B
Sam local generate-event - Generates a local event for Lambda function invocation.
C
Sam local start-lambda - Starts a local Lambda function instance.
D
Sam local start-api - Starts a local API Gateway for API testing.
No comments yet.