Q37 — AWS DVA-C02 Ch.2

Question 37 of 100 | ← Chapter 2

A developer created a Lambda function for a web application backend. When testing the Lambda function in the AWS Lambda console, the developer observes that the function executes, but no log data appears in Amazon CloudWatch Logs—even after several minutes. What is causing this behavior?

Correct Answer: C. The Lambda function’s execution role lacks permissions to write log data to CloudWatch Logs.

Explanation

Lambda automatically streams logs—including runtime startup/shutdown messages and stdout/stderr output—to CloudWatch Logs, provided the execution role has iam:PutLogEvents and logs:CreateLogStream permissions. Absence of logs despite successful execution almost always indicates missing IAM permissions (Option C). Option A is incorrect because even without explicit logging, Lambda emits default logs. Option B misrepresents CloudWatch Logs as a trigger—it is a destination, not a source. Option D is inaccurate because Lambda auto-creates the log group if permissions allow; absence of the log group is a symptom—not root cause—of permission failure.