# SnsDestination

Use a SNS topic as a Lambda destination.

Extends: SnsDestination
Implements: IDestination

- Source: [`aws-lambda-destinations/lib/sns.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-lambda-destinations/lib/sns.ts#L8)

## Example

```ts
// An sns topic for successful invocations of a lambda function
import * as sns from 'aws-cdk-lib/aws-sns';

const myTopic = new sns.Topic(this, 'Topic');

const myFn = new lambda.Function(this, 'Fn', {
  runtime: lambda.Runtime.NODEJS_LATEST,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
  // sns topic for successful invocations
  onSuccess: new destinations.SnsDestination(myTopic),
})
```

## Initializer

```ts
new SnsDestination(topic: ITopic)
```

## Methods

- `bind(_scope: Construct, fn: IFunction, _options?: DestinationOptions): DestinationConfig` — Returns a destination configuration.
