/
on-event-options.ts
57 lines (52 loc) · 1.58 KB
/
on-event-options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { Construct } from 'constructs';
import { EventPattern } from './event-pattern';
import { IRuleTarget } from './target';
/**
* Common options for Events.
*/
export interface EventCommonOptions {
/**
* A description of the rule's purpose.
*
* @default - No description
*/
readonly description?: string;
/**
* A name for the rule.
*
* @default AWS CloudFormation generates a unique physical ID.
*/
readonly ruleName?: string;
/**
* Additional 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.
*
* @see
* https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
*/
readonly eventPattern?: EventPattern;
/**
* The 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)
*/
readonly crossStackScope?: Construct;
}
/**
* Standard set of options for `onXxx` event handlers on construct
*/
export interface OnEventOptions extends EventCommonOptions {
/**
* The target to register for the event
*
* @default - No target is added to the rule. Use `addTarget()` to add a target.
*/
readonly target?: IRuleTarget;
}