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 230 discussion

A developer registered an AWS Lambda function as a target for an Application Load Balancer (ALB) using a CLI command. However, the Lambda function is not being invoked when the client sends requests through the ALB.

Why is the Lambda function not being invoked?

  • A. A Lambda function cannot be registered as a target for an ALB.
  • B. A Lambda function can be registered with an ALB using AWS Management Console only.
  • C. The permissions to invoke the Lambda function are missing.
  • D. Cross-zone is not enabled on the ALB.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
SerialiDr
Highly Voted 1 year, 4 months ago
Selected Answer: C
To allow an ALB to invoke a Lambda function, you need to grant the ALB permission to invoke the Lambda. This is typically done by adding a resource-based policy to the Lambda function, granting invoke permission to the ALB. If this permission is not set, the ALB will not be able to trigger the Lambda function in response to incoming requests.
upvoted 5 times
...
preachr
Most Recent 8 months, 4 weeks ago
Selected Answer: C
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html Permissions to invoke the Lambda function If you create the target group and register the Lambda function using the AWS Management Console, the console adds the required permissions to your Lambda function policy on your behalf. Otherwise, after you create the target group and register the function using the AWS CLI, you must use the add-permission command to grant Elastic Load Balancing permission to invoke your Lambda function. We recommend that you use the aws:SourceAccount and aws:SourceArn condition keys to restrict function invocation to the specified target group. aws lambda add-permission \ --function-name lambda-function-arn-with-alias-name \ --statement-id elb1 \ --principal elasticloadbalancing.amazonaws.com \ ....
upvoted 1 times
...
65703c1
1 year ago
Selected Answer: C
C is the correct answer.
upvoted 1 times
...
TanTran04
1 year, 6 months ago
Selected Answer: C
The Lambda function must have the lambda:InvokeFunction permission for the ALB to successfully invoke it.
upvoted 3 times
...
kaes
1 year, 6 months ago
Selected Answer: C
ANS: C
upvoted 3 times
...
Claire_KMT
1 year, 7 months ago
C. The permissions to invoke the Lambda function are missing.
upvoted 3 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 ...