AWS EventBridge cron vs rate expressions: which scheduler syntax to use

AWS EventBridge (formerly CloudWatch Events) supports two schedule expression types: cron(fields) for precise wall-clock scheduling and rate(value unit) for simple recurring intervals. Despite the name, EventBridge cron expressions use 6 fields (not 5), adding a year field. The extra field catches people migrating from Linux cron.

Schedule pattern
AWS EventBridge schedules
aws-eventbridge
Category
Platforms
Cloud and container scheduling

How this is calculated

EventBridge cron: cron(0 0 * * ? *) runs at midnight UTC every day. The 6 fields are minute, hour, day-of-month, month, day-of-week, year. The ? placeholder means 'no specific value' and is required in either the day-of-month or day-of-week field (one must be ?, the other a value). EventBridge rate: rate(5 minutes) is equivalent to every-5-minutes cron. Rate expressions only support minute, hour, and day units. For anything more complex than a fixed interval, use cron. EventBridge also supports timezone configuration per rule via the ScheduleExpressionTimezone parameter.

Verdict

Use rate() for simple recurring intervals (every 5 minutes, every hour, every day). Use cron() for wall-clock schedules (midnight UTC, first Monday of the month, 9 AM weekdays). Always specify a timezone on the rule to avoid the UTC surprise.

More Cron scenarios

Frequently asked questions

What is a Cron Job?
A cron job is a scheduled task that runs automatically on a Unix-like operating system (like Linux or macOS) at specific intervals. It is heavily used by developers to run background tasks like database backups, cache clearing, or sending nightly emails.
What do the 5 parts of a cron expression mean?
From left to right, the 5 fields are: Minute (0-59), Hour (0-23), Day of the Month (1-31), Month (1-12), and Day of the Week (0-6, where 0 and 7 are Sunday).
What does the asterisk (*) mean in Cron?
The asterisk acts as a wildcard, meaning 'every'. For example, if the minute field is an asterisk, the task runs every single minute. If the month field is an asterisk, the task runs every single month.
How do I run a task every 5 minutes?
To run a task every 5 minutes, use the slash operator in the minute field like this: */5 * * * *. The */5 means 'every 5th minute'.