How can EventBridge be used to schedule recurring tasks, and how does this compare to using cron directly?
Short answer
EventBridge supports scheduled rules using either a rate expression, such as every five minutes, or a standard cron expression for more specific scheduling needs, letting you trigger a Lambda function or other target automatically on a recurring basis without needing to run and…
Advertisement
AModel answer
EventBridge supports scheduled rules using either a rate expression, such as every five minutes, or a standard cron expression for more specific scheduling needs, letting you trigger a Lambda function or other target automatically on a recurring basis without needing to run and maintain your own dedicated scheduling server.
aws events put-rule --name 'DailyReportRule' --schedule-expression 'cron(0 9 * * ? *)'Real-world example
A finance team schedules an EventBridge rule to trigger a Lambda function every morning at nine that generates and emails a daily sales report, entirely without provisioning any server to run that scheduled job.
Likely follow-ups
- What is the difference between rate expressions and cron expressions in EventBridge?
- How does EventBridge Scheduler differ from scheduled rules?
Related topics