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.

asked 5 years ago1165 views
1 Answer
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>:*"
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions