0

I have a lambda function that has an SQS queue as a trigger. screenshot showing trigger added lambda

I've understood that this sort of trigger causes a synchronous invocation, and that if I want a destination, it must be set up accordingly.

The screenshot below shows the screen for adding a destination. I have selected "Event source mapping invocation" instead of "Asynchronous invocation" so that it can handle failure that were triggered by SQS. However the dropdown is empty and I cannot choose anything or proceed. screenshot showing page for adding destination

My question is, why is this dropdown empty? By already having the SQS queue as a trigger, have I not created an event source mapping here? What is this used for otherwise?

2 Answers 2

1

You have correctly set your event source mapping (i.e. trigger) as SQS as shown in the first screenshot. You will also be able to confirm this via the CLI using:

aws lambda list-event-source-mappings --function-name YOUR_FUNCTION_NAME

When configuring a destination, an Event source mapping invocation's source is for supported event sources, some of which are listed in the help dialog if you click "info". To set a destination with SQS queues (and also SNS topics, other Lambda functions, or EventBridge event buses) you have to select the Asynchronous invocation. This is also described in the help dialog, but can be confusing given Lambda synchronously processes events (not sure why it's listed there).

Sign up to request clarification or add additional context in comments.

3 Comments

Okay, clicking "info" I now see that "Event source mapping invocations – For all supported event sources, the destination can be an Amazon SQS queue or an Amazon SNS topic". When i set the destination as another sqs queue, it still doesn't allow me to choose any source. I have tried setting the trigger to s3 (which i understand is async) and still nothing shows up.
S3 doesn't show up for me as well, I have function with a SQS queue and Kinesis Data Stream as trigger and can confirm I can select the stream as source.
Ohhhh wait I just saw the note at the top of that info -- "Destinations for event source mappings are supported only for Kinesis, DynamoDB, and Kafka-based event source". I see now
0

As @PeskyPotato pointed out, the info panel says that Event Source Mapping is only available for certain sources,

enter image description here

Which is incompatible with my use case. Looks like I will need to figure out something else.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.