Schedule expressions using rate or cron
AWS Lambda supports standard rate and cron expressions for frequencies of up to once per minute. Rate expressions are simpler to define but do not offer the fine-grained schedule control that cron triggers support.
EventBridge (CloudWatch Events) rate expressions have the following format.
rate(
Value
Unit
)
Where Value
is a positive integer and Unit
can be
minute(s), hour(s), or day(s). A rate expression starts when you create the schedule. For a singular value the unit must be singular (for example, rate(1
day)
), otherwise plural (for example, rate(5 days)
).
Rate expression examples | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Frequency | Expression | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Every 5 minutes |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Every hour |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Every seven days |
|
Cron expressions have the following format.
cron(
Minutes
Hours
Day-of-month
Month
Day-of-week
Year
)
Cron expression examples | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Frequency | Expression | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10:15 AM (UTC+0) every day |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6:00 PM (UTC+0) Monday through Friday |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8:00 AM (UTC+0) on the first day of the month |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Every 10 min on weekdays |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Every 5 minutes between 8:00 AM (UTC+0) and 5:55 PM (UTC+0) weekdays |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9:00 AM (UTC+0) on the first Monday of each month |
|
Note the following:
-
All scheduled events use UTC+0 time zone.
-
If you are using the Lambda console, do not include the
cron
prefix in your expression. -
One of the day-of-month or day-of-week values must be a question mark (
?
).
For more information, see Using Lambda with Amazon EventBridge Scheduler.