A security engineer with administrator permissions signs in to the AWS Lambda console and tries to view Amazon CloudWatch logs for a function named myFunction. When selecting the option in the Lambda console to view logs in CloudWatch, an "error loading Log Streams" message appears. The Lambda function’s execution role has the following IAM policy statements. How should the security engineer resolve the error?
Choose an answer
Tap an option to check your answer.
Correct answer: Add the logs:CreateLogStream action to the second Allow statement..
Why this is the answer
The error "error loading Log Streams" indicates that the Lambda execution role lacks the necessary permissions to create log streams in CloudWatch. The logs:CreateLogStream action is required for Lambda to create a new log stream when it starts logging for a function. Adding this action to the Allow statement will resolve the issue. Moving logs:CreateLogGroup is incorrect because the role already has permission to create log groups, and moving it wouldn't address the missing CreateLogStream permission. logs:PutDestination is used for sending logs to a destination, not for creating log streams. logs:GetLogEvents is for retrieving log events, which is a read operation and not relevant to the creation of log streams.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed