- 最新
- 投票最多
- 评论最多
I followed this article and recreated the function from scratch and it worked. Seems like the AWS XRay access might have been the issue.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html
已回答 7 年前
Hello
Just in case, double check that your lambda function has the minimum role to write the logs in cloudwatch. It should have a role that includes the AWSLambdaBasicExecutionRole policy.
on the lambda function page, there is a monitoring tab where you can see if there are any issues. That might give you an idea of what else is needed. You can post the exact error message and maybe we can help more.
https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-logs.html
https://docs.aws.amazon.com/lambda/latest/dg/lambda-permissions.html
hope this helps,
RT
已回答 7 年前
In the Execution role I have:
{
"roleName": "lambda_role",
"policies": [
{
"document": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "logs:CreateLogGroup",
"Resource": "arn:aws:logs:us-east-2:696215482432:*"
},
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
"arn:aws:logs:us-east-2:696215482432:log-group:/aws/lambda/get-sheet-data:*"
]
}
]
},
"name": "AWSLambdaBasicExecutionRole-11a867c9-e852-454d-a3f3-4b402295bada",
"id": "ANPA2EGNNGBACNUXA63TP",
"type": "managed",
"arn": "arn:aws:iam::696215482432:policy/service-role/AWSLambdaBasicExecutionRole-11a867c9-e852-454d-a3f3-4b402295bada"
}
],
"trustedEntities": [
"lambda.amazonaws.com"
]
}
已回答 7 年前
I tried creating a brand new function. Ran the function then clicked "logs" and got this error:
There was an error loading Log Streams. Please try again by refreshing this page.
At the top of the cloudwatch page. Can't create a log stream either.
已回答 7 年前
Hello
To make it simple, try to run your function using the basic lambda role "AWSLambdaBasicExecutionRole"
if that works, then start limiting it.
https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_resource.html
hope this helps
RT
已回答 7 年前
