class SnsTopic
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Events.Targets.SnsTopic |
Java | software.amazon.awscdk.services.events.targets.SnsTopic |
Python | aws_cdk.aws_events_targets.SnsTopic |
TypeScript (source) | @aws-cdk/aws-events-targets » SnsTopic |
Implements
IRule
Use an SNS topic as a target for Amazon EventBridge rules.
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) });
Initializer
new SnsTopic(topic: ITopic, props?: SnsTopicProps)
Parameters
- topic
ITopic - props
SnsTopic Props
Properties
| Name | Type | Description |
|---|---|---|
| topic | ITopic |
topic
Type:
ITopic
Methods
| Name | Description |
|---|---|
| bind(_rule, _id?) | Returns a RuleTarget that can be used to trigger this SNS topic as a result from an EventBridge event. |
bind(_rule, _id?)
public bind(_rule: IRule, _id?: string): RuleTargetConfig
Parameters
- _rule
IRule - _id
string
Returns
Returns a RuleTarget that can be used to trigger this SNS topic as a result from an EventBridge event.

.NET
Java
Python
TypeScript (