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 Risposta
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
ESPERTO
Uri
con risposta 5 mesi fa
profile picture
ESPERTO
verificato un mese fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande