Denied Access to logs:CreateLogStream action as Root User

0

Hello.

I am new to AWS and was writing a function in AWS Lambda to create a log group and log stream. When I test in AWS Lambda, the log group is successfully created, but an error occurs when trying to create a log stream for that log group. As the root user, for some reason, I am getting a Client Error: Access Denied Exception because my root user "is not authorized to perform: logs:CreateLogStream" on the log_stream resource "because no identity-based policy allows the logs:CreateLogStream action." However, when I code something similar in my local IDE with Boto3, everything works as expected.

Appreciate any help!

1개 답변
2
수락된 답변

Hi,

when you run an AWS Lambda function, the function assumes a AWS IAM role. This is called the function execution role. The function has only the permissions that are defined in that role, regardless of what the permissions of your IAM user or role are. Please check the IAM role of the function and make sure that the correct permissions are assigned.

You can find more information here: https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html

profile pictureAWS
전문가
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
  • Thanks a lot for your response. Seems like I rushed through the creation of the function.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠