RuleProps

class aws_cdk.aws_events.RuleProps(*, description=None, enabled=None, event_bus=None, event_pattern=None, rule_name=None, schedule=None, targets=None)

Bases: object

Properties for defining an EventBridge Rule.

Parameters
  • description (Optional[str]) – A description of the rule’s purpose. Default: - No description.

  • enabled (Optional[bool]) – Indicates whether the rule is enabled. Default: true

  • event_bus (Optional[IEventBus]) – The event bus to associate with this rule. Default: - The default event bus.

  • event_pattern (Optional[EventPattern]) – Describes which events EventBridge routes to the specified target. These routed events are matched events. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide. Default: - None.

  • rule_name (Optional[str]) – A name for the rule. Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.

  • schedule (Optional[Schedule]) – The schedule or rate (frequency) that determines when EventBridge runs the rule. For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide. Default: - None.

  • targets (Optional[List[IRuleTarget]]) – Targets to invoke when this rule matches an event. Input will be the full matched event. If you wish to specify custom target input, use addTarget(target[, inputOptions]). Default: - No targets.

Attributes

description

A description of the rule’s purpose.

Default
  • No description.

Return type

Optional[str]

enabled

Indicates whether the rule is enabled.

Default

true

Return type

Optional[bool]

event_bus

The event bus to associate with this rule.

Default
  • The default event bus.

Return type

Optional[IEventBus]

event_pattern

Describes which events EventBridge routes to the specified target.

These routed events are matched events. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.

Default
  • None.

See

https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html

You must specify this property (either via props or via addEventPattern), the scheduleExpression property, or both. The method addEventPattern can be used to add filter values to the event pattern.

Return type

Optional[EventPattern]

rule_name

A name for the rule.

Default

  • AWS CloudFormation generates a unique physical ID and uses that ID

for the rule name. For more information, see Name Type.

Return type

Optional[str]

schedule

The schedule or rate (frequency) that determines when EventBridge runs the rule.

For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide.

Default
  • None.

See

https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html

You must specify this property, the eventPattern property, or both.

Return type

Optional[Schedule]

targets

Targets to invoke when this rule matches an event.

Input will be the full matched event. If you wish to specify custom target input, use addTarget(target[, inputOptions]).

Default
  • No targets.

Return type

Optional[List[IRuleTarget]]