Schedule Expressions Using Rate or Cron
AWS Lambda supports standard rate and cron expressions for frequencies of up to once per minute. CloudWatch Events rate expressions have the following format.
rate(ValueUnit)
Where Value is a positive integer and Unit can be
minute(s), hour(s), or day(s). 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(MinutesHoursDay-of-monthMonthDay-of-weekYear)
Cron Expression Examples
| Frequency | Expression |
|---|---|
|
10:15 AM (UTC) every day |
|
|
6:00 PM Monday through Friday |
|
|
8:00 AM on the first day of the month |
|
|
Every 10 min on weekdays |
|
|
Every 5 minutes between 8:00 AM and 5:55 PM weekdays |
|
|
9:00 AM on the first Monday of each month |
|
Note the following:
-
If you are using the Lambda console, do not include the
cronprefix to your expression. -
One of the day-of-month or day-of-week values must be a question mark (
?).
For more information, see Schedule Expressions for Rules in the CloudWatch Events User Guide.
