Trigger Lambda from SQS with delay after each trigger

0

I have a use case to trigger a lambda function from SQS queue and get data from cloudtrail lookup events api . But the api is giving Rate exceeded error because the SQS is triggering the lambda function continously without any delay so there is no delay in subsequent api requests . How can i control the trigger of lambda function with delays so that there is a gap in subsequent api requests .

2 Answers
2
Accepted Answer

Hello.

How about setting up a delay queue on the SQS side?
By setting this, you will be able to wait up to 15 minutes before processing a message.
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html

profile picture
EXPERT
answered 3 months ago
profile picture
EXPERT
reviewed a month ago
profile picture
EXPERT
reviewed 3 months ago
profile pictureAWS
EXPERT
reviewed 3 months ago
0

I have a lambda function that sends some data to sqs queue in form of messages like 10-15 messages at a time. Now what I want is when these messages arrive in queue I need a 30 sec delay after which these messages are sent to lambda function trigger . Setting delivery delay doesn't work for me because it delays all the messages for that particular time and after that it sends all at once

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions