Home > other >  Why does aws Step Func say it called my lambda fn, but there is no log group for that lambda?
Why does aws Step Func say it called my lambda fn, but there is no log group for that lambda?

Time:03-09

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 basic workflow:
enter image description here

Here's the configuration for that Lambda state:
enter image description here

Here's an execution of the state machine:
enter image description here

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

CodePudding user response:

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.

  • Related