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 年前檢視次數 1186 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南