51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
import type { TargetBaseProps } from './util';
|
|
import type * as events from '../../aws-events';
|
|
import * as iam from '../../aws-iam';
|
|
import type * as sns from '../../aws-sns';
|
|
/**
|
|
* Customize the SNS Topic Event Target
|
|
*/
|
|
export interface SnsTopicProps extends TargetBaseProps {
|
|
/**
|
|
* The message to send to the topic
|
|
*
|
|
* @default the entire EventBridge event
|
|
*/
|
|
readonly message?: events.RuleTargetInput;
|
|
/**
|
|
* Specifies whether an IAM role should be used to publish to the topic
|
|
*
|
|
* @default - true if `role` is provided, false otherwise
|
|
*/
|
|
readonly authorizeUsingRole?: boolean;
|
|
/**
|
|
* The IAM role to be used to publish to the topic
|
|
*
|
|
* @default - a new role will be created if `authorizeUsingRole` is true
|
|
*/
|
|
readonly role?: iam.IRole;
|
|
}
|
|
/**
|
|
* Use an SNS topic as a target for Amazon EventBridge rules.
|
|
* If the topic is imported the required permissions to publish to that topic need to be set manually.
|
|
*
|
|
* @example
|
|
* /// fixture=withRepoAndTopic
|
|
* // publish to an SNS topic every time code is committed
|
|
* // to a CodeCommit repository
|
|
* repository.onCommit('onCommit', { target: new targets.SnsTopic(topic) });
|
|
*
|
|
*/
|
|
export declare class SnsTopic implements events.IRuleTarget {
|
|
readonly topic: sns.ITopic;
|
|
private readonly props;
|
|
constructor(topic: sns.ITopic, props?: SnsTopicProps);
|
|
/**
|
|
* Returns a RuleTarget that can be used to trigger this SNS topic as a
|
|
* result from an EventBridge event.
|
|
*
|
|
* @see https://docs.aws.amazon.com/eventbridge/latest/userguide/resource-based-policies-eventbridge.html#sns-permissions
|
|
*/
|
|
bind(rule: events.IRuleRef, _id?: string): events.RuleTargetConfig;
|
|
}
|