Only invoke lambda during a specific timeframe each day

0

Hi,

I currently have a service that publishes a message to an SNS topic which has a subscription with name filter to add it to an SQS queue which ultimately triggers a lambda function.

I have a use-case for the same service to raise a message but for one specific filter name subscription to only invoke a lambda during a three-hour period 00:00 and 03:00. Out with of these hours, the messages should just backup and then redistribute the next day during this time window.

Is this possible, and how/what services are required to do this?

1 Answer
0

Add the messages to a queue and create an EventBridge schedule that enables a Lambda trigger from the queue at 00:00 and another schedule that disables the trigger at 03:00. This way the messages will be saved in the queue, but if it is outside the specified hours, no one will consume them. When the time comes, the Lambda will start processing the messages in the queue.

profile pictureAWS
EXPERT
Uri
answered 5 months ago
profile picture
EXPERT
reviewed 25 days 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