Detection

A Lambda function runs successfully, but its existing CloudWatch Logs streams receive no events. Its execution role allows logs:CreateLogGroup and logs:CreateLogStream but no other logging actions; which additional permission is required?

Show the answer

Correct answerC. Allow logs:PutLogEvents on the execution role.

AWhy not this: lambda:InvokeFunction authorizes invocation, not writing log events.

BWhy not this: logs:PutRetentionPolicy changes log retention rather than delivering events.

CWhy this is right: The execution role needs logs:PutLogEvents to write events to the function's log streams.

DWhy not this: The invoking user's permissions do not provide credentials for the function's log delivery.

Lambda uses its execution role to write function logs, which requires logs:PutLogEvents. Giving that permission to the invoking user does not grant it to the running function.