EventBridgeRule - AWS Serverless Application Model

EventBridgeRule

The object describing an EventBridgeRule event source type, which sets your state machine as the target for an Amazon EventBridge rule. For more information, see What Is Amazon EventBridge? in the Amazon EventBridge User Guide.

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.

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 DeadLetterConfig property of the AWS::Events::Rule Target data 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.

EventBusName

The event bus to associate with this rule. If you omit this property, AWS SAM uses the default event bus.

Type: String

Required: No

Default: Default event bus

AWS CloudFormation compatibility: This property is passed directly to the EventBusName property of an AWS::Events::Rule resource.

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 Input property of an AWS::Events::Rule Target resource.

InputPath

When you don't want to pass the entire matched event to the target, use the InputPath property to describe which part of the event to pass.

Type: String

Required: No

AWS CloudFormation compatibility: This property is passed directly to the InputPath property of an AWS::Events::Rule Target resource.

Pattern

Describes which events are routed to the specified target. For more information, see Events and Event Patterns in EventBridge in the Amazon EventBridge User Guide.

Type: EventPattern

Required: Yes

AWS CloudFormation compatibility: This property is passed directly to the EventPattern property of an AWS::Events::Rule resource.

RetryPolicy

A RetryPolicy object 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 RetryPolicy property of the AWS::Events::Rule Target data type.

Examples

EventBridgeRule

The following is an example of an EventBridgeRule event source type.

YAML

EBRule: Type: EventBridgeRule Properties: Input: '{"Key": "Value"}' Pattern: detail: state: - terminated