Lambda function logs missing from CloudWatch when invoked from activity

0

Hello.

When using the "arn:aws:states:::lambda:invoke" resource to invoke lambda functions no output is sent to the CloudWatch logs.
Is there any parameter missing?
A sample activity has:

"PollQueryResult": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"Parameters": {
"FunctionName": "Function:$LATEST",
"Payload": {
"Input.$": "$.query.Payload"
}
},
"InputPath": "$",
"ResultPath": "$.poll",
"OutputPath": "$",
"Next": "QueryResultChoice",
}

Thanks.

已提问 5 年前1187 查看次数
1 回答
0

Found that the problem was with the ARNs provided to the IAM Policy.
To help others that eventually have this issues, below is the template I'm using for new policies:

      - Effect: Allow  
        Action:  
        - logs:CreateLogGroup  
        Resource: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:*"  
      - Effect: Allow  
        Action:  
        - logs:CreateLogStream  
        - logs:PutLogEvents  
        Resource:  
        - !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/<FUNCTIONAME>:*"  
        - !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/<FUNCTIONAME>:*"
已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则