UNPKG

1.14 kBTypeScriptView Raw
1import * as events from '@aws-cdk/aws-events';
2import * as sns from '@aws-cdk/aws-sns';
3/**
4 * Customize the SNS Topic Event Target
5 */
6export interface SnsTopicProps {
7 /**
8 * The message to send to the topic
9 *
10 * @default the entire EventBridge event
11 */
12 readonly message?: events.RuleTargetInput;
13}
14/**
15 * Use an SNS topic as a target for Amazon EventBridge rules.
16 *
17 * @example
18 * /// fixture=withRepoAndTopic
19 * // publish to an SNS topic every time code is committed
20 * // to a CodeCommit repository
21 * repository.onCommit('onCommit', { target: new targets.SnsTopic(topic) });
22 *
23 */
24export declare class SnsTopic implements events.IRuleTarget {
25 readonly topic: sns.ITopic;
26 private readonly props;
27 constructor(topic: sns.ITopic, props?: SnsTopicProps);
28 /**
29 * Returns a RuleTarget that can be used to trigger this SNS topic as a
30 * result from an EventBridge event.
31 *
32 * @see https://docs.aws.amazon.com/eventbridge/latest/userguide/resource-based-policies-eventbridge.html#sns-permissions
33 */
34 bind(_rule: events.IRule, _id?: string): events.RuleTargetConfig;
35}