

# Amazon EventBridge Scheduler
<a name="using-eventbridge-scheduler"></a>

[Amazon EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html) is a serverless scheduler that allows you to create, run, and manage tasks from one central, managed service. With EventBridge Scheduler, you can create schedules using cron and rate expressions for recurring patterns, or configure one-time invocations. You can set up flexible time windows for delivery, define retry limits, and set the maximum retention time for failed API invocations.

![\[At specific times or defined intervals, the schedule sends tasks to your specified AWS service API.\]](http://docs.aws.amazon.com/eventbridge/latest/userguide/images/schedule-types_eventbridge_conceptual.svg)


EventBridge Scheduler is highly customizable, and offers improved scalability over [EventBridge scheduled rules](eb-create-rule-schedule.md), with a wider set of target API operations and AWS services. We recommend that you use EventBridge Scheduler to invoke targets on a schedule.

## Set up the execution role
<a name="using-eventbridge-scheduler-execution-role"></a>

 When you create a new schedule, EventBridge Scheduler must have permission to invoke its target API operation on your behalf. You grant these permissions to EventBridge Scheduler using an *execution role*. The permission policy you attach to your schedule's execution role defines the required permissions. These permissions depend on the target API you want EventBridge Scheduler to invoke.

 When you use the EventBridge Scheduler console to create a schedule, as in the following procedure, EventBridge Scheduler automatically sets up an execution role based on your selected target. If you want to create a schedule using one of the EventBridge Scheduler SDKs, the AWS CLI, or CloudFormation, you must have an existing execution role that grants the permissions EventBridge Scheduler requires to invoke a target. For more information about manually setting up an execution role for your schedule, see [Setting up an execution role](https://docs.aws.amazon.com/scheduler/latest/UserGuide/setting-up.html#setting-up-execution-role) in the *EventBridge Scheduler User Guide*. 

## Related resources
<a name="using-eventbridge-scheduler-related-resources"></a>

 For more information about EventBridge Scheduler, see the following: 
+ [EventBridge Scheduler User Guide](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html)
+ [EventBridge Scheduler API Reference](https://docs.aws.amazon.com/scheduler/latest/APIReference/Welcome.html)
+ [EventBridge Scheduler Pricing](https://aws.amazon.com/eventbridge/pricing/#Scheduler)

## Create a schedule
<a name="using-eventbridge-scheduler-create"></a>

**To create a schedule by using the console**

1. Open the Amazon EventBridge Scheduler console at [https://console.aws.amazon.com/scheduler/home](https://console.aws.amazon.com/scheduler/home/).

1.  On the **Schedules** page, choose **Create schedule**. 

1.  On the **Specify schedule detail** page, in the **Schedule name and description** section, do the following: 

   1. For **Schedule name**, enter a name for your schedule. For example, **MyTestSchedule**. 

   1. (Optional) For **Description**, enter a description for your schedule. For example, **My first schedule**.

   1. For **Schedule group**, choose a schedule group from the dropdown list. If you don't have a group, choose **default**. To create a schedule group, choose **create your own schedule**. 

      You use schedule groups to add tags to groups of schedules. 

1. 

   1. Choose your schedule options.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/eventbridge/latest/userguide/using-eventbridge-scheduler.html)

1. (Optional) If you chose **Recurring schedule** in the previous step, in the **Timeframe** section, do the following: 

   1. For **Timezone**, choose a timezone. 

   1. For **Start date and time**, enter a valid date in `YYYY/MM/DD` format, and then specify a timestamp in 24-hour `hh:mm` format. 

   1. For **End date and time**, enter a valid date in `YYYY/MM/DD` format, and then specify a timestamp in 24-hour `hh:mm` format. 

1. Choose **Next**. 

1. On the **Select target** page, choose the AWS API operation that EventBridge Scheduler invokes: 

   1. For **Target API**, choose **Templated targets**.

   1. Choose **Amazon EventBridge PutEvents**.

   1. Under **PutEvents**, specify the following:
      + For **EventBridge event bus**, choose the event bus from the drop-down menu. For example, **default**.

        You can also create a new event bus in the EventBridge console by choosing **Create new event bus**.
      + For **Detail-type**, enter the detail type of the events you want to match. For example, **Object Created**.
      + For **Source**, enter the name of the service that is the source of the events. 

        For AWS service events, specify the service prefix as the source. Do not include the `aws.` prefix. For example, for Amazon S3 events, enter **s3**.

        To determine a service's prefix, see [The condition keys table](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html#context_keys_table) in the *Service Authorization Reference*. For more information about source and detail-type event values, see [AWS service event metadata](https://docs.aws.amazon.com/eventbridge/latest/ref/events-structure.html) in the *Events Reference*.>.
      + (Optional): For **Detail**, enter an event pattern to further filter the events EventBridge Scheduler sends to EventBridge.

        For more information, see [Creating Amazon EventBridge event patterns](eb-event-patterns.md).

1. Choose **Next**. 

1. On the **Settings** page, do the following: 

   1. To turn on the schedule, under **Schedule state**, toggle **Enable schedule**. 

   1. To configure a retry policy for your schedule, under **Retry policy and dead-letter queue (DLQ)**, do the following:
      + Toggle **Retry**.
      + For **Maximum age of event**, enter the maximum **hour(s)** and **min(s)** that EventBridge Scheduler must keep an unprocessed event.
      + The maximum time is 24 hours.
      + For **Maximum retries**, enter the maximum number of times EventBridge Scheduler retries the schedule if the target returns an error. 

         The maximum value is 185 retries. 

      With retry policies, if a schedule fails to invoke its target, EventBridge Scheduler re-runs the schedule. If configured, you must set the maximum retention time and retries for the schedule.

   1. Choose where EventBridge Scheduler stores undelivered events.     
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/eventbridge/latest/userguide/using-eventbridge-scheduler.html)

   1. To use a customer managed key to encrypt your target input, under **Encryption**, choose **Customize encryption settings (advanced)**. 

      If you choose this option, enter an existing KMS key ARN or choose **Create an AWS KMS key** to navigate to the AWS KMS console. For more information about how EventBridge Scheduler encrypts your data at rest, see [Encryption at rest](https://docs.aws.amazon.com/scheduler/latest/UserGuide/encryption-rest.html) in the *Amazon EventBridge Scheduler User Guide*. 

   1. To have EventBridge Scheduler create a new execution role for you, choose **Create new role for this schedule**. Then, enter a name for **Role name**. If you choose this option, EventBridge Scheduler attaches the required permissions necessary for your templated target to the role.

1. Choose **Next**. 

1.  In the **Review and create schedule** page, review the details of your schedule. In each section, choose **Edit** to go back to that step and edit its details. 

1. Choose **Create schedule**. 

   You can view a list of your new and existing schedules on the **Schedules** page. Under the **Status** column, verify that your new schedule is **Enabled**. 

# Creating a scheduled rule (legacy) in Amazon EventBridge
<a name="eb-create-rule-schedule"></a>

**Note**  
Scheduled rules are a legacy feature of EventBridge.  
EventBridge offers a more flexible and powerful way to create, run, and manage scheduled tasks centrally, at scale: EventBridge Scheduler. With EventBridge Scheduler, you can create schedules using cron and rate expressions for recurring patterns, or configure one-time invocations. You can set up flexible time windows for delivery, define retry limits, and set the maximum retention time for failed API invocations.   
Scheduler is highly customizable, and offers improved scalability over scheduled rules, with a wider set of target API operations and AWS services. We recommend that you use Scheduler to invoke targets on a schedule.  
For more information, see [Create a schedule](using-eventbridge-scheduler.md#using-eventbridge-scheduler-create) or the *[EventBridge Scheduler User Guide](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html)*.

In EventBridge, you can create two types of scheduled rules: 
+ Rules that run at a regular rate

  EventBridge runs these rules at regular intervals; for example, every 20 minutes.

  To specify the rate for a scheduled rule, you define a *rate expression*.
+ Rules that run at specific times

  EventBridge runs these rules at specific times and dates; for example, 8:00 a.m. PST on the first Monday of every month.

  To specify the time and dates a scheduled rule runs, you define a *cron expression*.

Rate expressions are simpler to define, while cron expressions offer detailed schedule control. For example, with a cron expression, you can define a rule that runs at a specified time on a certain day of each week or month. In contrast, rate expressions run a rule at a regular rate, such as once every hour or once every day.

All scheduled events use UTC\$10 time zone, and the minimum precision for a schedule is one minute.

**Note**  
EventBridge doesn't provide second-level precision in schedule expressions. The finest resolution using a cron expression is one minute. Due to the distributed nature of EventBridge and the target services, there can be a delay of several seconds between the time the scheduled rule is triggered and the time the target service runs the target resource. 

## Create a scheduled rule (legacy)
<a name="eb-create-scheduled-rule"></a>

The following steps walk you through how to create an EventBridge rule that runs on a regular schedule.

**Note**  
You can only create scheduled rules using the default event bus.

**Topics**
+ [Define the rule](#eb-create-scheduled-rule-define)
+ [Define the schedule](#eb-create-scheduled-rule-schedule)
+ [Select targets](#eb-create-scheduled-rule-target)
+ [Configure tags and review rule](#eb-create-scheduled-rule-review)

### Define the rule
<a name="eb-create-scheduled-rule-define"></a>

First, enter a name and description for your rule to identify it.

**To define the rule detail**

1. Open the Amazon EventBridge console at [https://console.aws.amazon.com/events/](https://console.aws.amazon.com/events/).

1. In the navigation pane, under **Scheduler**, choose **Scheduled rule (legacy)**.

1. Choose **Create scheduled rule**.

1. Enter a **Name** and, optionally, a **Description** for the rule.

   A rule can't have the same name as another rule in the same AWS Region and on the same event bus.

1. To have the rule take effect as soon as you create it, make sure the **Enable the scheduled rule** option is enabled.

### Define the schedule
<a name="eb-create-scheduled-rule-schedule"></a>

Next, define the schedule pattern.

**To define the schedule pattern**
+ For **Schedule pattern**, choose whether you want the schedule to run at a specific time, or at a regular rate:

------
#### [ Specific time ]

  1. Choose **A fine-grained schedule that runs at a specific time, such as 8:00 a.m. PST on the first Monday of every month.** 

  1. For **Cron expression**, specify fields to define the cron expresssion that EventBridge should use to determine when to execute this scheduled rule.

     Once you have specified all fields, EventBridge displays the next ten dates when EventBridge will execute this scheduled rule. You can choose whether to display those dates in **UTC** or **Local time zone**.

     For more information on constructing a cron expression, see [Cron expressions](eb-scheduled-rule-pattern.md#eb-cron-expressions).

------
#### [ Regular rate ]

  1. Choose **A schedule that runs at a regular rate, such as every 10 minutes.**

  1. For **Rate expression**, specify the **Value** and **Unit** fields to define the rate at which EventBridge should execute this scheduled rule.

     For more information on constructing a rate expression, see [Rate expressions](eb-scheduled-rule-pattern.md#eb-rate-expressions).

------

### Select targets
<a name="eb-create-scheduled-rule-target"></a>

Choose one or more targets to receive events that match the specified pattern. Targets can include an EventBridge event bus, EventBridge API destinations, including SaaS partners such as Salesforce, or another AWS service.

**To select targets**

1. For **Target type**, choose one of the following target types:

------
#### [ Event bus ]

   To select an EventBridge event bus, select **EventBridge event bus**, then do the following:
   + To use an event bus in the same AWS Region as this rule: 

     1. Select **Event bus in the same account and Region**.

     1. For **Event bus for target**, choose the dropdown box and enter the name of the event bus. You can also select the event bus from the dropdown list.

        For more information, see [Sending events between event buses in the same account and Region in Amazon EventBridge](eb-bus-to-bus.md).
   + To use an event bus in a different AWS Region or account as this rule:

     1. Select **Event bus in a different account or Region**.

     1. For **Event bus as target**, enter the ARN of the event bus you want to use.

        For more information, see: 
        + [Sending and receiving events between AWS accounts in Amazon EventBridge](eb-cross-account.md)
        + [Sending and receiving events between AWS Regions in Amazon EventBridge](eb-cross-region.md)

------
#### [ API destination ]

   To use an EventBridge API destination, select **EventBridge API destination**, then do one of the following:
   + To use an existing API destination, select **Use an existing API destination**. Then select an API destination from the dropdown list.
   + To create a new API destination, select **Create a new API destination**. Then, provide the following details for the destination:
     + **Name** – Enter a name for the destination. 

       Names must be unique within your AWS account. Names can have up to 64 characters. Valid characters are **A-Z**, **a-z**, **0-9**, and **.** **\$1** **-** (hyphen).
     + (Optional) **Description** – Enter a description for the destination. 

       Descriptions can have up to 512 characters.
     + **API destination endpoint** – The URL endpoint for the target. 

       The endpoint URL must start with **https**. You can include the **\$1** as a path parameter wildcard. You can set path parameters from the target's `HttpParameters` attribute.
     + **HTTP method** – Select the HTTP method used when you invoke the endpoint.
     + (Optional) **Invocation rate limit per second** – Enter the maximum number of invocations accepted for each second for this destination. 

       This value must be greater than zero. By default, this value is set to 300.
     + **Connection** – Choose to use a new or existing connection: 
       + To use an existing connection, select **Use an existing connection** and select the connection from the dropdown list. 
       + To create a new connection for this destination select **Create a new connection**, then define the connection's **Name**, **Destination type**, and **Authorization type**. You can also add an optional **Description** for this connection.

   For more information, see [API destinations as targets in Amazon EventBridge](eb-api-destinations.md).

------
#### [ AWS service ]

   To use an AWS service, select **AWS service**, then do the following:

   1. For **Select a target**, select an AWS service to use as the target. Provide the information requested for the service you select.
**Note**  
The fields displayed vary depending on the service selected. For more information about available targets, see [Event bus targets available in the EventBridge console](eb-targets.md#eb-console-targets).

------

1. For many target types, EventBridge needs permissions to send events to the target. In these cases, EventBridge can create the IAM role needed for your rule to run. 

   For **Execution role**, do one of the following:
   + To create a new execution role for this rule:

     1. Select **Create a new role for this specific resource**.

     1. Either enter a name for this execution role, or use the name generated by EventBridge.
   + To use an existing execution role for this rule:

     1. Select **Use existing role**.

     1. Enter or select the name of the execution role to use from the dropdown list.

1. (Optional) For **Additional settings**, specify any of the optional settings available for your target type:

------
#### [ Event bus ]

   (Optional) For **Dead-letter queue**, choose whether to use a standard Amazon SQS queue as a dead-letter queue. EventBridge sends events that match this rule to the dead-letter queue if they are not successfully delivered to the target. Do one of the following:
   + Choose **None** to not use a dead-letter queue.
   + Choose **Select an Amazon SQS queue in the current AWS account to use as the dead-letter queue** and then select the queue to use from the drop-down list.
   + Choose **Select an Amazon SQS queue in an other AWS account as a dead-letter queue** and then enter the ARN of the queue to use. You must attach a resource-based policy to the queue that grants EventBridge permission to send messages to it. 

     For more information, see [Granting permissions to the dead-letter queue](eb-rule-dlq.md#eb-dlq-perms).

------
#### [ API destination ]

   1. (Optional) For Configure target input, choose how you want to customize the text sent to the target for matching events. Choose one of the following:
      + **Matched events** – EventBridge sends the entire original source event to the target. This is the default.
      + **Part of the matched events** – EventBridge only sends the specified portion of the original source event to the target.

        Under **Specify the part of the matched event**, specify a JSON path that defines the part of the event you want EventBridge to send to the target.
      + **Constant (JSON text)** – EventBridge sends only the specified JSON text to the target. No part of the original source event is sent.

        Under **Specify the constant in JSON**, specify the JSON text that you want EventBridge to send to the target instead of the event.
      + **Input transformer** – Configure an input transformer to customize the text you want EventBridge send to the target. For more information, see [Amazon EventBridge input transformation](eb-transform-target-input.md).

        1. Select **Configure input transformer**.

        1. Configure the input transformer following the steps in [Configuring an input transformer when creating a rule in EventBridge](eb-transform-input-rule.md).

   1. (Optional) Under **Retry policy**, specify how EventBridge should retry sending an event to a target after an error occurs.
      + **Maximum age of event** – Enter the maximum amount of time (in hours, minutes, and seconds) for EventBridge to retain unprocessed events. The default is 24 hours.
      + **Retry attempts** – Enter the maximum number of times EventBridge should retry sending an event to the target after an error occurs. The default is 185 times.

   1. (Optional) For **Dead-letter queue**, choose whether to use a standard Amazon SQS queue as a dead-letter queue. EventBridge sends events that match this rule to the dead-letter queue if they are not successfully delivered to the target. Do one of the following:
      + Choose **None** to not use a dead-letter queue.
      + Choose **Select an Amazon SQS queue in the current AWS account to use as the dead-letter queue** and then select the queue to use from the drop-down list.
      + Choose **Select an Amazon SQS queue in an other AWS account as a dead-letter queue** and then enter the ARN of the queue to use. You must attach a resource-based policy to the queue that grants EventBridge permission to send messages to it. 

        For more information, see [Granting permissions to the dead-letter queue](eb-rule-dlq.md#eb-dlq-perms).

------
#### [ AWS service ]

   Note that EventBridge may not display all of the following fields for a given AWS service.

   1. (Optional) For Configure target input, choose how you want to customize the text sent to the target for matching events. Choose one of the following:
      + **Matched events** – EventBridge sends the entire original source event to the target. This is the default.
      + **Part of the matched events** – EventBridge only sends the specified portion of the original source event to the target.

        Under **Specify the part of the matched event**, specify a JSON path that defines the part of the event you want EventBridge to send to the target.
      + **Constant (JSON text)** – EventBridge sends only the specified JSON text to the target. No part of the original source event is sent.

        Under **Specify the constant in JSON**, specify the JSON text that you want EventBridge to send to the target instead of the event.
      + **Input transformer** – Configure an input transformer to customize the text you want EventBridge send to the target. For more information, see [Amazon EventBridge input transformation](eb-transform-target-input.md).

        1. Select **Configure input transformer**.

        1. Configure the input transformer following the steps in [Configuring an input transformer when creating a rule in EventBridge](eb-transform-input-rule.md).

   1. (Optional) Under **Retry policy**, specify how EventBridge should retry sending an event to a target after an error occurs.
      + **Maximum age of event** – Enter the maximum amount of time (in hours, minutes, and seconds) for EventBridge to retain unprocessed events. The default is 24 hours.
      + **Retry attempts** – Enter the maximum number of times EventBridge should retry sending an event to the target after an error occurs. The default is 185 times.

   1. (Optional) For **Dead-letter queue**, choose whether to use a standard Amazon SQS queue as a dead-letter queue. EventBridge sends events that match this rule to the dead-letter queue if they are not successfully delivered to the target. Do one of the following:
      + Choose **None** to not use a dead-letter queue.
      + Choose **Select an Amazon SQS queue in the current AWS account to use as the dead-letter queue** and then select the queue to use from the drop-down list.
      + Choose **Select an Amazon SQS queue in an other AWS account as a dead-letter queue** and then enter the ARN of the queue to use. You must attach a resource-based policy to the queue that grants EventBridge permission to send messages to it. 

        For more information, see [Granting permissions to the dead-letter queue](eb-rule-dlq.md#eb-dlq-perms).

------

1. (Optional) Choose **Add another target** to add another target for this rule.

1. Choose **Next**.

### Configure tags and review rule
<a name="eb-create-scheduled-rule-review"></a>

Finally, enter any desired tags for the rule, then review and create the rule.

**To configure tags, and review and create the rule**

1. (Optional) Enter one or more tags for the rule. For more information, see [Tagging resources in Amazon EventBridge](eb-tagging.md).

1. Choose **Next**.

1. Review the details for the new rule. To make changes to any section, choose the **Edit** button next to that section.

   When satisfied with the rule details, choose **Create rule**.

# Setting a schedule pattern for scheduled rules (legacy) in Amazon EventBridge
<a name="eb-scheduled-rule-pattern"></a>

**Note**  
Scheduled rules are a legacy feature of EventBridge.  
EventBridge offers a more flexible and powerful way to create, run, and manage scheduled tasks centrally, at scale: EventBridge Scheduler. With EventBridge Scheduler, you can create schedules using cron and rate expressions for recurring patterns, or configure one-time invocations. You can set up flexible time windows for delivery, define retry limits, and set the maximum retention time for failed API invocations.   
Scheduler is highly customizable, and offers improved scalability over scheduled rules, with a wider set of target API operations and AWS services. We recommend that you use Scheduler to invoke targets on a schedule.  
For more information, see [Create a schedule](using-eventbridge-scheduler.md#using-eventbridge-scheduler-create) or the *[EventBridge Scheduler User Guide](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html)*.

When you create a scheduled rule in EventBridge you can specify a schedule pattern that determines when EventBridge runs the rule:
+ Use a *cron* expression to run the rule at specific times and dates.
+ Use a *rate* expression to run the rule at regular intervals.

## Cron expressions
<a name="eb-cron-expressions"></a>

Cron expressions have six required fields, which are separated by white space.

**Syntax**

```
cron(fields)
```


| **Field** | **Values** | **Wildcards** | 
| --- | --- | --- | 
|  Minutes  |  0-59  |  , - \$1 /  | 
|  Hours  |  0-23  |  , - \$1 /  | 
|  Day-of-month  |  1-31  |  , - \$1 ? / L W  | 
|  Month  |  1-12 or JAN-DEC  |  , - \$1 /  | 
|  Day-of-week  |  1-7 or SUN-SAT  |  , - \$1 ? L \$1  | 
|  Year  |  1970-2199  |  , - \$1 /  | 

**Wildcards**
+ The **,** (comma) wildcard includes additional values. In the Month field, JAN,FEB,MAR includes January, February, and March.
+ The **-** (dash) wildcard specifies ranges. In the Day field, 1-15 includes days 1 through 15 of the specified month.
+ The **\$1** (asterisk) wildcard includes all values in the field. In the Hours field, **\$1** includes every hour. You can't use **\$1** in both the Day-of-month and Day-of-week fields. If you use it in one, you must use **?** in the other.
+ The **/** (slash) wildcard specifies increments. In the Minutes field, you could enter 1/10 to specify every tenth minute, starting from the first minute of the hour (for example, the 11th, 21st, and 31st minute, and so on).
+ The **?** (question mark) wildcard specifies any. In the Day-of-month field you could enter **7** and if any day of the week was acceptable, you could enter **?** in the Day-of-week field.
+ The **L** wildcard in the Day-of-month or Day-of-week fields specifies the last day of the month or week.
+ The **W** wildcard in the Day-of-month field specifies a weekday. In the Day-of-month field, **3W** specifies the weekday closest to the third day of the month.
+ The **\$1** wildcard in the Day-of-week field specifies a certain instance of the specified day of the week within a month. For example, 3\$12 would be the second Tuesday of the month: the 3 refers to Tuesday because it is the third day of each week, and the 2 refers to the second day of that type within the month.
**Note**  
If you use a '\$1' character, you can define only one expression in the day-of-week field. For example, `"3#1,6#3"` is not valid because it is interpreted as two expressions.

**Limitations**
+ You can't specify the Day-of-month and Day-of-week fields in the same cron expression. If you specify a value or a \$1 (asterisk) in one of the fields, you must use a **?** (question mark) in the other.
+ Cron expressions that lead to rates faster than 1 minute are not supported.

**Examples**  
You can use the following sample cron strings when creating a rule with schedule.


| Minutes | Hours | Day of month | Month | Day of week | Year | Meaning | 
| --- | --- | --- | --- | --- | --- | --- | 
|  0  |  10  |  \$1  |  \$1  |  ?  |  \$1  |  Run at 10:00 am (UTC\$10) every day  | 
|  15  |  12  |  \$1  |  \$1  |  ?  |  \$1  |  Run at 12:15 pm (UTC\$10) every day  | 
|  0  |  18  |  ?  |  \$1  |  MON-FRI  |  \$1  |  Run at 6:00 pm (UTC\$10) every Monday through Friday  | 
|  0  |  8  |  1  |  \$1  |  ?  |  \$1  |  Run at 8:00 am (UTC\$10) every 1st day of the month  | 
|  0/15  |  \$1  |  \$1  |  \$1  |  ?  |  \$1  |  Run every 15 minutes  | 
|  0/10  |  \$1  |  ?  |  \$1  |  MON-FRI  |  \$1  |  Run every 10 minutes Monday through Friday  | 
|  0/5  |  8-17  |  ?  |  \$1  |  MON-FRI  |  \$1  |  Run every 5 minutes Monday through Friday between 8:00 am and 5:55 pm (UTC\$10)  | 
|  0/30  |  20-2  |  ?  |  \$1  |  MON-FRI  |  \$1  |  Run every 30 minutes Monday through Friday between 10:00 pm on the starting day to 2:00 am on the following day (UTC) Run from 12:00 am to 2:00 am on Monday morning (UTC).  | 



The following example creates a rule that runs every day at 12:00pm UTC\$10.

```
aws events put-rule --schedule-expression "cron(0 12 * * ? *)" --name MyRule1
```

The following example creates a rule that runs every day, at 2:05pm and 2:35pm UTC\$10.

```
aws events put-rule --schedule-expression "cron(5,35 14 * * ? *)" --name MyRule2
```

The following example creates a rule that runs at 10:15am UTC\$10 on the last Friday of each month during the years 2019 to 2022.

```
aws events put-rule --schedule-expression "cron(15 10 ? * 6L 2019-2022)" --name MyRule3
```

## Rate expressions
<a name="eb-rate-expressions"></a>

A *rate expression* starts when you create the scheduled event rule, and then it runs on a defined schedule.

Rate expressions have two required fields separated by white space.

**Syntax**

```
rate(value unit)
```

value  
A positive number.

unit  
The unit of time. Different units are required for values of 1, such as `minute`, and values over 1, such as `minutes`.  
Valid values: minute \$1 minutes \$1 hour \$1 hours \$1 day \$1 days

**Limitations**  
If the value is equal to 1, then the unit must be singular. If the value is greater than 1, the unit must be plural. For example, rate(1 hours) and rate(5 hour) aren't valid, but rate(1 hour) and rate(5 hours) are valid.

**Examples**  
The following examples show how to use rate expressions with the AWS CLI `put-rule` command. The first example triggers the rule every minute, the next triggers it every five minutes, the third example triggers it once an hour, and the final example triggers it once per day.

```
aws events put-rule --schedule-expression "rate(1 minute)" --name MyRule2
```

```
aws events put-rule --schedule-expression "rate(5 minutes)" --name MyRule3
```

```
aws events put-rule --schedule-expression "rate(1 hour)" --name MyRule4
```

```
aws events put-rule --schedule-expression "rate(1 day)" --name MyRule5
```