11

I'm using aws SQS to trigger a lambda function, after I send message to sqs, when I want to see the cloudwatch log in lambda, I got this error. I'm in the same aws region, any idea what this happened?

Log group does not exist
The specific log group: /aws/lambda/configurationTest does not exist in this account or region
2
  • If you go to Lambda Fxn > Monitor > Logs, do you see entries under 'Recent Invocations'? Commented Jun 4, 2021 at 19:41
  • Make sure your Lambda invocation role has access to CloudWatch Log. Commented Jun 4, 2021 at 20:58

3 Answers 3

11

Invoke lambda for the first time, it will create the log group.

Sign up to request clarification or add additional context in comments.

2 Comments

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
This was actually helpful. For lambdas that did not have log groups, it was an indication that I had not successfully made a call to the lambda. One way of jogging this is by making a 'test' call from the AWS console.
9

This error happen when newly created Lambda execution role doesn't have access CloudWatch log write access.

Steps :

  1. Go to IAM
  2. Select role and add policy to write CloudWatch log.

3 Comments

Don't forget to upvote answer if this help you.
I had the same issue with aws glue python shell job
not sure about aws glue. but hint is if any service not able to access other then obvious IAM issue.
1

If you are using multiple lambda functions to have the same execution role (not recommended) you should explicitly specify each lambda ARN in the resource of the cloudwatch policy. As an example:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "logs:CreateLogGroup",
            "Resource": "arn:aws:logs:REGION:ACCOUNT_ID:*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogStream",
                "logs:PutLogEvents"
            ],
            "Resource": [
                "arn:aws:logs:REGION:ACCOUNT_ID:log-group:/aws/lambda/main_function:*",
                "arn:aws:logs:REGION:ACCOUNT_ID:log-group:/aws/lambda/second_function:*"
            ]
        }
    ]
}

This way your functions will be able to create log_group for each function.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.