Schedule
The object describing a Schedule event source type, which sets your state machine as the target of an EventBridge rule that triggers on a schedule. For more information, see What Is Amazon EventBridge? in the Amazon EventBridge User Guide.
AWS Serverless Application Model (AWS SAM) generates an AWS::Events::Rule resource when this event type is set.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
DeadLetterConfig:DeadLetterConfigDescription:StringEnabled:BooleanInput:StringName:StringRetryPolicy:RetryPolicyRoleArn:StringSchedule:StringState:StringTarget:Target
Properties
-
DeadLetterConfig -
Configure the Amazon Simple Queue Service (Amazon SQS) queue where EventBridge sends events after a failed target invocation. Invocation can fail, for example, when sending an event to a Lambda function that doesn't exist, or when EventBridge has insufficient permissions to invoke the Lambda function. For more information, see Event retry policy and using dead-letter queues in the Amazon EventBridge User Guide.
Type: DeadLetterConfig
Required: No
AWS CloudFormation compatibility: This property is similar to the
DeadLetterConfigproperty of theAWS::Events::RuleTargetdata type. The AWS SAM version of this property includes additional subproperties, in case you want AWS SAM to create the dead-letter queue for you. -
Description -
A description of the rule.
Type: String
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Descriptionproperty of anAWS::Events::Ruleresource. -
Enabled -
Indicates whether the rule is enabled.
To disable the rule, set this property to
false.Note
Specify either the
EnabledorStateproperty, but not both.Type: Boolean
Required: No
AWS CloudFormation compatibility: This property is similar to the
Stateproperty of anAWS::Events::Ruleresource. If this property is set totruethen AWS SAM passesENABLED, otherwise it passesDISABLED. -
Input -
Valid JSON text passed to the target. If you use this property, nothing from the event text itself is passed to the target.
Type: String
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Inputproperty of anAWS::Events::Rule Targetresource. -
Name -
The name of the rule. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the rule name.
Type: String
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Nameproperty of anAWS::Events::Ruleresource. -
RetryPolicy -
A
RetryPolicyobject that includes information about the retry policy settings. For more information, see Event retry policy and using dead-letter queues in the Amazon EventBridge User Guide.Type: RetryPolicy
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
RetryPolicyproperty of theAWS::Events::RuleTargetdata type. -
RoleArn -
The ARN of the IAM role that EventBridge Scheduler will use for the target when the schedule is invoked.
Type: RoleArn
Required: No. If not provided, a new role will be created and used.
AWS CloudFormation compatibility: This property is passed directly to the
RoleArnproperty of theAWS::Scheduler::ScheduleTargetdata type. -
Schedule -
The scheduling expression that determines when and how often the rule runs. For more information, see Schedule Expressions for Rules.
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is passed directly to the
ScheduleExpressionproperty of anAWS::Events::Ruleresource. -
State -
The state of the rule.
Accepted values:
DISABLED | ENABLEDNote
Specify either the
EnabledorStateproperty, but not both.Type: String
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Stateproperty of anAWS::Events::Ruleresource. -
Target -
The AWS resource that EventBridge invokes when a rule is triggered. You can use this property to specify the logical ID of the target. If this property is not specified, then AWS SAM generates the logical ID of the target.
Type: Target
Required: No
AWS CloudFormation compatibility: This property is similar to the
Targetsproperty of anAWS::Events::Ruleresource. The AWS SAM version of this property only allows you to specify the logical ID of a single target.
Examples
CloudWatch Schedule Event
CloudWatch Schedule Event Example
YAML
CWSchedule: Type: Schedule Properties: Schedule: 'rate(1 minute)' Name: TestSchedule Description: test schedule Enabled: false