0
votes

I set up a Cloudwatch trigger for my Lambda function to get files from S3, add data, and send them back to S3. It works when I hit the test button and now I want to create a Cloudwatch trigger. I set it up but it does not work as scheduled. I have got IAM account with AWSLambdaFullAccess and wonder how can I troubleshoot it and make it sure it does trigger my function?

1

1 Answers

1
votes

sounds like a lambda permission...you need to allow cloudwatch to invoke lambda (see https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html)

something like:

aws lambda add-permission \
--function-name LogScheduledEvent \
--statement-id my-scheduled-event \
--action 'lambda:InvokeFunction' \
--principal events.amazonaws.com \
--source-arn arn:aws:events:us-east-1:123456789012:rule/my-scheduled-rule