Defines an EventBridge Rule in this stack.
import { Rule } from 'aws-cdk-lib/aws-events';Or use the module namespace:
import * as events from 'aws-cdk-lib/aws-events';
// events.RuleConfiguration passed to the constructor as RuleProps.
enabledOptionalbooleanIndicates whether the rule is enabled.
Default: true
eventBusOptionalIEventBusRefThe event bus to associate with this rule.
Default: - The default event bus.
roleOptionalIRoleRefThe role that is used for target invocation. Must be assumable by principal `events.amazonaws.com`.
Default: - No role associated
scheduleOptionalScheduleThe schedule or rate (frequency) that determines when EventBridge runs the rule. You must specify this property, the `eventPattern` property, or both. For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide.
Default: - None.
targetsOptionalIRuleTarget[]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.
EventCommonOptionscrossStackScopeOptionalinherited from EventCommonOptionsConstructThe scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations.
Default: - none (the main scope will be used, even for cross-stack Events)
descriptionOptionalinherited from EventCommonOptionsstringA description of the rule's purpose.
Default: - No description
eventPatternOptionalinherited from EventCommonOptionsEventPatternAdditional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering.
Default: - No additional filtering based on an event pattern.
ruleNameOptionalinherited from EventCommonOptionsstringA name for the rule.
Default: AWS CloudFormation generates a unique physical ID.
Everything you need to know about Amazon EventBridge on one page. HD quality, print-friendly.
Download Free Infographicaws-events