aws-cdk-lib.aws_lambda_event_sources.SqsEventSource

class SqsEventSource

LanguageType name
.NETAmazon.CDK.AWS.Lambda.EventSources.SqsEventSource
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambdaeventsources#SqsEventSource
Javasoftware.amazon.awscdk.services.lambda.eventsources.SqsEventSource
Pythonaws_cdk.aws_lambda_event_sources.SqsEventSource
TypeScript (source)aws-cdk-lib » aws_lambda_event_sources » SqsEventSource

Implements IEventSource

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

Example

import { SqsEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';

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

const eventSourceId = eventSource.eventSourceMappingId;
const eventSourceMappingArn = eventSource.eventSourceMappingArn;

Initializer

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

Parameters

  • queue IQueue
  • props SqsEventSourceProps

Properties

NameTypeDescription
eventSourceMappingArnstringThe ARN for this EventSourceMapping.
eventSourceMappingIdstringThe identifier for this EventSourceMapping.
queueIQueue

eventSourceMappingArn

Type: string

The ARN for this EventSourceMapping.


eventSourceMappingId

Type: string

The identifier for this EventSourceMapping.


queue

Type: IQueue

Methods

NameDescription
bind(target)Called by lambda.addEventSource to allow the event source to bind to this function.

bind(target)

public bind(target: IFunction): void

Parameters

  • target IFunction

Called by lambda.addEventSource to allow the event source to bind to this function.