Search code examples
amazon-web-servicesaws-lambdaaws-event-bridge

How to get Lambda function working in EventBridge?


What am I missing?

I've written a Lambda function, tested it and it works perfectly.

I've created an EventBridge schedule with the Lambda function as the target. Current schedule is every 30 mins.

The execution role is configured for the EventBridge-Scheduler-Execution-Policy and LambdaBasicExecutionRole

But it doesn't run - the lambda function never runs.

I know I've generalised some account specific information, but can anyone recognise what I've done wrong?


Solution

  • I recommend using EventBridge scheduler which has templated targets to simplify the setup. If you set this up in the console, the IAM role will also be generated. I recommend attaching a dead-letter queue as well to capture errors (but note that Lambda is invoked asynchronously, i.e., Lambda runtime failures must be handled via the Lambda async OnSuccess/OnFailure handlers, or other means). https://docs.aws.amazon.com/lambda/latest/dg/with-eventbridge-scheduler.html