Creating an EventBridge Rule That Triggers on a Schedule
Use the following steps to create an EventBridge rule that triggers on a regular schedule. You can create scheduled rules only using the default event bus.
To create a rule that triggers on a regular schedule
-
Open the Amazon EventBridge console at https://console.aws.amazon.com/events/
. -
In the navigation pane, choose Rules.
-
Choose Create rule.
-
Enter a name and description for the rule.
A rule can't have the same name as another rule in the same Region and on the same event bus.
-
For Define pattern, choose Schedule.
-
Either choose Fixed rate of and specify how often the task is to run, or choose Cron expression and specify a cron expression that defines when the task is to be triggered. For more information about cron expression syntax, see Schedule Expressions for Rules.
-
For Select event bus, choose AWS default event bus. Scheduled rules are supported only on the default event bus.
-
For Select targets, choose the AWS service that is to act on the specified schedule.
-
In the other fields in this section, enter information specific to this target type, if any is needed.
-
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:
-
To create an IAM role automatically, choose Create a new role for this specific resource
-
To use an IAM role that you created before, choose Use existing role
-
-
For Retry policy and dead-letter queue:, under Retry policy:
-
For Maximum age of event, enter a value between 1 minute (00:01) and 24 hours (24:00).
-
For Retry attempts, enter a number between 0 and 185.
-
-
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. To learn more, see Granting permissions to the DLQ.
-
-
(Optional) Choose Add target to add another target for this rule.
-
(Optional) Enter one or more tags for the rule. For more information, see Tagging Your Amazon EventBridge Resources.
-
Choose Create.