UNPKG

1.39 kBTypeScriptView Raw
1import * as cdk from '@aws-cdk/core';
2import { IBucket } from './bucket';
3import { Construct } from '@aws-cdk/core';
4/**
5 * Implemented by constructs that can be used as bucket notification destinations.
6 */
7export interface IBucketNotificationDestination {
8 /**
9 * Registers this resource to receive notifications for the specified
10 * bucket. This method will only be called once for each destination/bucket
11 * pair and the result will be cached, so there is no need to implement
12 * idempotency in each destination.
13 * @param bucket The bucket object to bind to
14 */
15 bind(scope: Construct, bucket: IBucket): BucketNotificationDestinationConfig;
16}
17/**
18 * Represents the properties of a notification destination.
19 */
20export interface BucketNotificationDestinationConfig {
21 /**
22 * The notification type.
23 */
24 readonly type: BucketNotificationDestinationType;
25 /**
26 * The ARN of the destination (i.e. Lambda, SNS, SQS).
27 */
28 readonly arn: string;
29 /**
30 * Any additional dependencies that should be resolved before the bucket notification
31 * can be configured (for example, the SNS Topic Policy resource).
32 */
33 readonly dependencies?: cdk.IDependable[];
34}
35/**
36 * Supported types of notification destinations.
37 */
38export declare enum BucketNotificationDestinationType {
39 LAMBDA = 0,
40 QUEUE = 1,
41 TOPIC = 2
42}