EventBridgeRule - AWS Serverless Application Model

EventBridgeRule

The object describing an EventBridgeRule event source type.

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

EventBusName: String Input: String InputPath: String Pattern: EventPattern TargetId: String

Properties

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.

TargetId

A name for the events rule target that EventBridge invokes when a rule is triggered. The TargetId can include alphanumeric characters, periods (.), hyphens (-), and underscores (_).

If this property is not specified, AWS SAM will generate a TargetId value.

Type: String

Required: No

AWS CloudFormation compatibility: This property is passed directly to the Id 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