exam questions

Exam AWS Certified Developer Associate All Questions

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

Exam AWS Certified Developer Associate topic 1 question 220 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 220
Topic #: 1
[All AWS Certified Developer Associate Questions]

An AWS Lambda function that Is running in a test environment is not working property. However, there is no error associated with the Lambda function in the Amazon CloudWatch logs for the account. The Lambda function's permissions do not include a resource-based policy. The Lambda function's execution role has properly configured trust relationships and has no permissions policies attached.

Which action should a developer take to allow logs for the Lambda function to appear in CloudWatch?

  • A. Attach the AWSLambda8asicExecutionRole managed policy to the Lambda function's execution role.
  • B. Set the AWSLambdaBasicExecutionRole managed policy as the Lambda function's resource-based policy.
  • C. Attach the CloudWatchLambdaInsightsExecutionRolePolicy managed policy to the Lambda function's execution role.
  • D. Set the CloudWatchLambdaInsightsExecutionRolePolicy managed policy as the Lambda function's resource-based policy.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
prakashJS
4 months, 3 weeks ago
Selected Answer: A
A is correct
upvoted 1 times
...
sweetheatmn
1 year, 6 months ago
Selected Answer: A
AWSLambdaBasicExecutionRole allows the lambda function to write logs to CloudWatch https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSLambdaBasicExecutionRole.html
upvoted 1 times
...
stlim83
1 year, 11 months ago
Selected Answer: A
It should be A https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSLambdaBasicExecutionRole.html
upvoted 3 times
...
Rpod
1 year, 11 months ago
Selected Answer: C
C it should be
upvoted 1 times
...
ondrejc
2 years ago
Selected Answer: C
C is best option in my opinion.
upvoted 2 times
...
Syre
2 years ago
Selected Answer: C
Stop agreeing on wrong answers. Option A is not correct because attaching the AWSLambdaBasicExecutionRole policy to the Lambda function's execution role is not related to CloudWatch logs. This policy only grants the basic permissions needed for the Lambda function to run, such as writing to CloudWatch Logs and creating and deleting network interfaces.
upvoted 1 times
tccam
1 year, 8 months ago
The question, as it is written, says that the problem is that no logs are written. The AWSLambdaBasicExecution role has, on Resource *, CreateLogGroup, CreateLogStream, PutLogEvents. CloudWatchLambdaInsightsExecutionRolePolicy has those exact same permissions, but narrows PutLogStream and PutLogEvents to log-group:/aws/lambda-insights, and Lambda Insights is a tool not mentioned in the question. It would be overkill for the stated problem, and Lambda by default would not try to log to that location-- so the permission would be wasted. https://docs.aws.amazon.com/lambda/latest/dg/monitoring-insights.html#monitoring-insights-enabling-programmatically So yes, stop agreeing on the wrong answer.
upvoted 3 times
...
...
pancman
2 years, 2 months ago
Selected Answer: A
A is correct
upvoted 1 times
...
michaldavid
2 years, 5 months ago
Selected Answer: A
A - AWSLambdaBasicExecutionRole grants permissions to upload logs to CloudWatch
upvoted 2 times
...
k1kavi1
2 years, 5 months ago
Selected Answer: A
I agree
upvoted 1 times
...
kapil206001
2 years, 5 months ago
Sorry my bad , its A AWSLambdaBasicExecutionRole grants permissions to upload logs to CloudWatch.
upvoted 1 times
...
kapil206001
2 years, 5 months ago
C https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago