1 Answer
- Newest
- Most votes
- Most comments
2
Well it could be multiple things, like if both (eventbridge and lambda) are on the same account, or probably a simpler explanation how did you create the lambda function. Lambda functions have a resource policy control, which you need to configure to allow it to be invoked from the eventbridge service, so you need to add something like this:
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
To make sure that EventBrige can invoke the lambda function, you have a good example documented here: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-run-lambda-schedule.html
Hope this helps. Anyway for the next time if you can include your cloudtrail Deny event would help a lot to diagnose. Thanks!
Best,
answered 20 days ago
Relevant content
- asked 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 9 months ago
@Neel, the issue you're encountering is likely due to an incorrect Principal in your role trust policy. You should be using
events.amazonaws.com
instead.Key Source:
Thanks for link to the documentation. I was able to setup a Rule instead of a Schedule to run the lambda using the CLI. The Principal role Trust Policy is now set to events.amazonaws.com instead of scheduler.amazonaws.com