为什么 aws Step Func 说它调用了我的 lambda fn,但该 lambda 没有日志组?
我有一个调用 lambda 函数的状态机。当我执行状态机时,它说执行成功。当我单击 Lambda 步骤时,我可以看到它应该调用的 lambda 的 ARN、输入和输出 (null)。该输出不是预期的。当我点击该功能的 CloudWatch 日志组链接时,发现过去几个小时内没有日志组。这表明 lambda 当前正在被调用。
同样,输出为 null
,并且此 lambda 的 cloudWatch 日志组不包含最近的日志记录。
我确实必须重新部署 lambda 来解决管道问题。在这次改变之前它是有效的。为了解决这个问题,我删除了状态机的内容并从头开始重新创建它。
我缺少什么?
谢谢
I have a state machine that calls a lambda function. When I execute the state machine, it says the execution was successful. 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). That output is not expected. And when I follow the link to the CloudWatch log group for that function, there's no log group in last few hours. This suggests that the lambda is even being invoked currently.
Here's the configuration for that Lambda state:
Here's an execution of the state machine:
Again, output is null
and the cloudWatch log group for this lambda contains no recent log records.
I did have to redeploy the lambda to fix a pipeline issue. It was working before that change. To account for that I deleted the contents of the state machine and re-created it from scratch.
What am I missing?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您确信 Lambda 函数确实执行了,但没有写入 CloudWatch Logs,那么这可能是由于缺乏日志记录权限造成的。
典型 Lambda 函数的 IAM 角色有权写入 CloudWatch Logs。以下是此类政策的示例。或者,您可以使用 Lambda 的 AWS 托管策略,例如 AWSLambdaBasicExecutionRole。
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.
A typical Lambda function's IAM role has permission to write to 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.