SqsDestination

class aws_cdk.aws_lambda_destinations.SqsDestination(queue)

Bases: object

Use a SQS queue as a Lambda destination.

ExampleMetadata

infused

Example:

# An sqs queue for unsuccessful invocations of a lambda function
import aws_cdk.aws_sqs as sqs


dead_letter_queue = sqs.Queue(self, "DeadLetterQueue")

my_fn = lambda_.Function(self, "Fn",
    runtime=lambda_.Runtime.NODEJS_12_X,
    handler="index.handler",
    code=lambda_.Code.from_inline("// your code"),
    # sqs queue for unsuccessful invocations
    on_failure=destinations.SqsDestination(dead_letter_queue)
)
Parameters

queue (IQueue) –

Methods

bind(_scope, fn, *, type)

Returns a destination configuration.

Parameters
Return type

DestinationConfig