class SnsTopic
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Events.Targets.SnsTopic |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#SnsTopic |
Java | software.amazon.awscdk.services.events.targets.SnsTopic |
Python | aws_cdk.aws_events_targets.SnsTopic |
TypeScript (source) | aws-cdk-lib » aws_events_targets » SnsTopic |
Implements
IRule
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) });
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
Go
Java
Python
TypeScript (