# SnsTopic

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.

Extends: SnsTopic
Implements: IRuleTarget

- Source: [`aws-events-targets/lib/sns.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-events-targets/lib/sns.ts#L46)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

```ts
  /// 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

```ts
new SnsTopic(topic: ITopic, props?: SnsTopicProps)
```

## Properties

- `topic`: [ITopic](/cdk/api/v2/docs/aws-cdk-lib.aws_sns.ITopic.html) (required)

## Methods

- `bind(rule: IRuleRef, _id?: string): RuleTargetConfig` — Returns a RuleTarget that can be used to trigger this SNS topic as a result from an EventBridge event.
