1

I need a lambda function that poll events from a fifo SQS queue only the first day of the month. Is it possible?

For example:

  • One lambda adds some events to a queue only the first day of the month.

  • Another lambda should process queue's messages in the same day.

Requirements

  • Each message must be processed by a dedicated lambda invocation
  • Lambda Function's Concurrency Limit is set to 1.
  • The polling from the queue should occurr only the first day of the month, since on other days the queue is empty.

I'm looking for a solution like the one suggested by AWS here. The only difference is that the polling should only take place on the first day of the month in order to save money.

Pater
  • 83
  • 1
  • 6
  • 1
    I doubt that the automatic polling from AWS Lambda to the SQS queue would generate a noticeable cost. I recommend you skip the require to "only poll on the first day of the month" until you have some evidence that there is a cost involved that is above the monthly Free Tier level. – John Rotenstein Dec 14 '22 at 06:23
  • Why do you have a requirement of "Each message must be processed by a dedicated lambda invocation"? – John Rotenstein Dec 14 '22 at 06:24
  • Perhaps a first of the month scheduled event using EventBridge to trigger a Step Function that orchestrates the processing of the available messages in the queue. Step Functions invokes your desired Lambda function which polls for the next available message, returning some kind of 'stop iteration' message when the queue is empty, otherwise an indication of success which causes Step Functions to invoke the Lambda again, to process the next message etc. until done. – jarmod Dec 14 '22 at 18:22

0 Answers0