# SqsEventSource

Use an Amazon SQS queue as an event source for AWS Lambda.

Extends: SqsEventSource
Implements: IEventSource

- Source: [`aws-lambda-event-sources/lib/sqs.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-lambda-event-sources/lib/sqs.ts#L97)
- Type last changed: v2.77.0 · 26 Apr 2023

## Example

```ts
import * as eventsources from 'aws-cdk-lib/aws-lambda-event-sources';
import * as sqs from 'aws-cdk-lib/aws-sqs';

declare const fn: lambda.Function;
const queue = new sqs.Queue(this, 'Queue');
fn.addEventSource(new eventsources.SqsEventSource(queue));
```

## Initializer

```ts
new SqsEventSource(queue: IQueue, props?: SqsEventSourceProps)
```

## Properties

- `eventSourceMappingArn`: string (required) — The ARN for this EventSourceMapping.

- `eventSourceMappingId`: string (required) — The identifier for this EventSourceMapping.

- `queue`: [IQueue](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.IQueue.html) (required)

## Methods

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