0
votes

I would like to create a Scheduled Events to run a Lambda to execute an api call every 1 minute (cron-line behaviour).

The caveat to this setup is that; the external api is un-reliable / slow and the api call sometimes could last longer than 1 minute.

So, my question here is; given the setup & scenario - would AWS run another Scheduled Event and execute the lambda before the previous executing finished? I.e. overlap?

If it does; is there a way to configure the scheduled event to not "overlap"?

I did some initial research into this and came across this article: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html

It looks like you can set concurrency limits at function level? Is this the way to achieve non-overlapping scheduled lambda executions? i.e. set the function's concurrency limit to 1?

1

1 Answers

5
votes

Yes by default it will execute your Lambda function every 1 minute, regardless if the previous invocation has completed or not.

To enforce no more than one running instance of your Lambda function at a time, set the Concurrency setting of your Lambda function to 1.