Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 86 discussion

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?

  • A. Run the sam package and sam deploy commands. Create a Lambda test event from the AWS Management Console. Test the Lambda function.
  • B. Run the cdk synth and cdk deploy commands. Create a Lambda test event from the AWS Management Console. Test the Lambda function.
  • C. Run the cdk synth and sam local invoke commands with the function construct identifier and the path to the synthesized CloudFormation template.
  • D. Run the cdk synth and sam local start-lambda commands with the function construct identifier and the path to the synthesized CloudFormation template.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
MrTee
Highly Voted 1 year, 6 months ago
Selected Answer: C
The developer can test a specific Lambda function locally by running the cdk synth command to synthesize the AWS CDK application into an AWS CloudFormation template. Then, the developer can use the sam local invoke command with the function construct identifier and the path to the synthesized CloudFormation template to test the Lambda function locally (option C).
upvoted 13 times
...
Dushank
Highly Voted 1 year, 2 months ago
Selected Answer: C
o test a specific Lambda function locally when using the AWS Cloud Development Kit (AWS CDK), the developer can use the AWS Serverless Application Model (AWS SAM) CLI's local testing capabilities in conjunction with the CDK. The typical process would be: Run cdk synth to synthesize the AWS CDK app into a CloudFormation template. Use sam local invoke to run the specific Lambda function locally, providing the function's logical identifier and the path to the synthesized CloudFormation template as arguments.
upvoted 5 times
...
nbxyzd
Most Recent 1 week, 6 days ago
Selected Answer: C
Note that the sam local start-lambda subcommand starts a local endpoint to emulate AWS Lambda.
upvoted 1 times
...
Anandesh
3 months, 3 weeks ago
Selected Answer: C
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-cdk-testing.html
upvoted 1 times
...
65703c1
5 months, 3 weeks ago
Selected Answer: C
C is the correct answer.
upvoted 1 times
...
KillThemWithKindness
8 months, 3 weeks ago
Selected Answer: C
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-invoke.html sam local invoke: Invoke Lambda locally sam local start-lambda: Integrating with automated-tests
upvoted 1 times
...
NaghamAbdellatif
12 months ago
Selected Answer: C
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-cdk-testing.html C
upvoted 1 times
...
fossil123
1 year, 2 months ago
Selected Answer: C
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
upvoted 2 times
...
JamalDaBoss
1 year, 3 months ago
Selected Answer: C
Answer is clearly C. If you say it's not C, you are wrong.
upvoted 2 times
...
zodraz
1 year, 6 months ago
Selected Answer: C
sam local invoke StackLogicalId/FunctionLogicalId https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/using-sam-cli-local-invoke.html
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...