class SqsEventSource
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Lambda.EventSources.SqsEventSource |
![]() | software.amazon.awscdk.services.lambda.eventsources.SqsEventSource |
![]() | aws_cdk.aws_lambda_event_sources.SqsEventSource |
![]() | @aws-cdk/aws-lambda-event-sources » SqsEventSource |
Implements
IEvent
Use an Amazon SQS queue as an event source for AWS Lambda.
Example
import { SqsEventSource } from '@aws-cdk/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;
Initializer
new SqsEventSource(queue: IQueue, props?: SqsEventSourceProps)
Parameters
- queue
IQueue
- props
Sqs
Event Source Props
Properties
Name | Type | Description |
---|---|---|
event | string | The identifier for this EventSourceMapping. |
queue | IQueue |
eventSourceMappingId
Type:
string
The identifier for this EventSourceMapping.
queue
Type:
IQueue
Methods
Name | Description |
---|---|
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.