-
Notifications
You must be signed in to change notification settings - Fork 4k
/
destination.ts
46 lines (41 loc) · 1.26 KB
/
destination.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
import { Construct, IDependable } from 'constructs';
import { IBucket } from './bucket';
/**
* Implemented by constructs that can be used as bucket notification destinations.
*/
export interface IBucketNotificationDestination {
/**
* Registers this resource to receive notifications for the specified
* bucket. This method will only be called once for each destination/bucket
* pair and the result will be cached, so there is no need to implement
* idempotency in each destination.
* @param bucket The bucket object to bind to
*/
bind(scope: Construct, bucket: IBucket): BucketNotificationDestinationConfig;
}
/**
* Represents the properties of a notification destination.
*/
export interface BucketNotificationDestinationConfig {
/**
* The notification type.
*/
readonly type: BucketNotificationDestinationType;
/**
* The ARN of the destination (i.e. Lambda, SNS, SQS).
*/
readonly arn: string;
/**
* Any additional dependencies that should be resolved before the bucket notification
* can be configured (for example, the SNS Topic Policy resource).
*/
readonly dependencies?: IDependable[];
}
/**
* Supported types of notification destinations.
*/
export enum BucketNotificationDestinationType {
LAMBDA,
QUEUE,
TOPIC,
}