DVA-C02 · Question #101
A developer is implementing an AWS Cloud Development Kit (AWS CDK) serverless application. The developer will provision several AWS Lambda functions and Amazon API Gateway APIs during AWS CloudFormati
The correct answer is C. Run the cdk synth and sam local invoke commands with the function construct identifier and the. Use the AWS SAM CLI sam local invoke subcommand to initiate a one-time invocation of an AWS Lambda function locally. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli- local-invoke.html
Question
A developer is implementing an AWS Cloud Development Kit (AWS CDK) serverless application. The developer will provision several AWS Lambda functions and Amazon API Gateway APIs during AWS CloudFormation stack creation. The developer's workstation has the AWS Serverless Application Model (AWS SAM) and the AWS CDK installed locally. How can the developer test a specific Lambda function locally?
Options
- ARun the sam package and sam deploy commands. Create a Lambda test event from the AWS
- BRun the cdk synth and cdk deploy commands. Create a Lambda test event from the AWS
- CRun the cdk synth and sam local invoke commands with the function construct identifier and the
- DRun the cdk synth and sam local start-lambda commands with the function construct identifier
How the community answered
(28 responses)- A7% (2)
- B4% (1)
- C82% (23)
- D7% (2)
Explanation
Use the AWS SAM CLI sam local invoke subcommand to initiate a one-time invocation of an AWS Lambda function locally. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli- local-invoke.html
Community Discussion
No community discussion yet for this question.