# SnsEventSource

Use an Amazon SNS topic as an event source for AWS Lambda.

Extends: SnsEventSource
Implements: IEventSource

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

## Example

```ts
import * as sns from 'aws-cdk-lib/aws-sns';
import { SnsEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';

declare const topic: sns.Topic;
const deadLetterQueue = new sqs.Queue(this, 'deadLetterQueue');

declare const fn: lambda.Function;
fn.addEventSource(new SnsEventSource(topic, {
  filterPolicy: { },
  deadLetterQueue: deadLetterQueue,
}));
```

## Initializer

```ts
new SnsEventSource(topic: ITopic, props?: SnsEventSourceProps)
```

## Properties

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

## Methods

- `bind(target: IFunction): void` — Called by `lambda.addEventSource` to allow the event source to bind to this function.
