简体   繁体   English

为什么 aws Step Func 说它叫我的 lambda fn,但是没有那个 lambda 的日志组?

[英]Why does aws Step Func say it called my lambda fn, but there is no log group for that lambda?

I have a state machine that calls a lambda function. When I execute the state machine, it says the execution was successful.我有一个 state 机器调用 lambda function。当我执行 state 机器时,它说执行成功。 When I click on the Lambda step, I can see the ARN of the lambda it should be calling, I can see the input, and I can see the output (null).当我点击 Lambda 步骤时,我可以看到它应该调用的 lambda 的 ARN,我可以看到输入,我可以看到 output(空)。 That output is not expected.预计不会出现 output。 And when I follow the link to the CloudWatch log group for that function, there's no log group in last few hours.当我点击指向该 function 的 CloudWatch 日志组的链接时,发现最近几个小时没有日志组。 This suggests that the lambda is even being invoked currently.这表明当前甚至正在调用 lambda。

Here's the basic workflow:这是基本的工作流程:
在此处输入图像描述

Here's the configuration for that Lambda state:这是 Lambda state 的配置:
在此处输入图像描述

Here's an execution of the state machine:这是 state 机器的执行:
在此处输入图像描述

Again, output is null and the cloudWatch log group for this lambda contains no recent log records.同样,output 是null ,此 lambda 的 cloudWatch 日志组不包含最近的日志记录。

I did have to redeploy the lambda to fix a pipeline issue.我确实必须重新部署 lambda 来解决管道问题。 It was working before that change.它在那个变化之前工作。 To account for that I deleted the contents of the state machine and re-created it from scratch.为了解决这个问题,我删除了 state 机器的内容并从头开始重新创建它。

What am I missing?我错过了什么?

Thank you谢谢

If you're confident that the Lambda function did execute but no CloudWatch Logs were written then that is probably caused by lack of logging permissions.如果您确信 Lambda function 确实执行但没有写入 CloudWatch 日志,那么这可能是由于缺少日志记录权限造成的。

A typical Lambda function's IAM role has permission to write to CloudWatch Logs.典型的 Lambda 函数的 IAM 角色有权写入 CloudWatch Logs。 Here is an example of such a policy.这是此类政策的示例 Alternatively, you can use one of the AWS managed policies for Lambda , for example AWSLambdaBasicExecutionRole.或者,您可以使用 Lambda 的AWS 托管策略之一,例如 AWSLambdaBasicExecutionRole。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM