DVA-C02 · Question #667
A developer created a Lambda function for a web application backend. When testing the Lambda function from the AWS Lambda console, the developer can see that the function is being run, but there is…
The correct answer is C. The execution role for the Lambda function is missing permissions to write log data to the. Even if your function executes, Lambda needs IAM permissions to create log groups/streams and push log events to CloudWatch Logs. Without the AWSLambdaBasicExecutionRole (or equivalent logs:CreateLogGroup, logs:CreateLogStream, and logs:PutLogEvents permissions) on the…
Question
A developer created a Lambda function for a web application backend. When testing the Lambda function from the AWS Lambda console, the developer can see that the function is being run, but there is no log data being generated in Amazon CloudWatch Logs, even after several minutes. What could cause this situation?
Options
- AThe Lambda function does not have any explicit log statements for the log data to send it to
- BThe Lambda function is missing CloudWatch Logs as a source trigger to send log data.
- CThe execution role for the Lambda function is missing permissions to write log data to the
- DThe Lambda function is missing a target CloudWatch Log group.
How the community answered
(26 responses)- B4% (1)
- C92% (24)
- D4% (1)
Explanation
Even if your function executes, Lambda needs IAM permissions to create log groups/streams and push log events to CloudWatch Logs. Without the AWSLambdaBasicExecutionRole (or equivalent logs:CreateLogGroup, logs:CreateLogStream, and logs:PutLogEvents permissions) on the execution role, no log data will appear.
Community Discussion
No community discussion yet for this question.