class SqsDestination
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lambda.Destinations.SqsDestination |
Java | software.amazon.awscdk.services.lambda.destinations.SqsDestination |
Python | aws_cdk.aws_lambda_destinations.SqsDestination |
TypeScript (source) | @aws-cdk/aws-lambda-destinations » SqsDestination |
Implements
IDestination
Use a SQS queue as a Lambda destination.
Example
// An sqs queue for unsuccessful invocations of a lambda function
import * as sqs from '@aws-cdk/aws-sqs';
const deadLetterQueue = new sqs.Queue(this, 'DeadLetterQueue');
const myFn = new lambda.Function(this, 'Fn', {
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.Code.fromInline('// your code'),
// sqs queue for unsuccessful invocations
onFailure: new destinations.SqsDestination(deadLetterQueue),
});
Initializer
new SqsDestination(queue: IQueue)
Parameters
- queue
IQueue
Methods
Name | Description |
---|---|
bind(_scope, fn, _options?) | Returns a destination configuration. |
bind(_scope, fn, _options?)
public bind(_scope: Construct, fn: IFunction, _options?: DestinationOptions): DestinationConfig
Parameters
- _scope
Construct
- fn
IFunction
- _options
Destination
Options
Returns
Returns a destination configuration.