Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if AWS Lambda function is already running before run schedule cron

I have a recurring AWS Lambda function, which is scheduled to run every 15 minutes. I would like to validate if it is running before being invoked again after 15 minutes.

Is there any AWS feature that checks this? Or will I have to develop another lambda to validate?

like image 585
Sergio RBJ Avatar asked Apr 26 '26 02:04

Sergio RBJ


1 Answers

As per the AWS Documentation here, you an set the concurrency to either guarantee the that your function can reach a certain concurrency level, or, conversely, you can use concurrency to limit the maximum number of concurrent invocations.

To achieve your goal, simply set the concurrency to 1 and if there is another execution in progress your invocation will throw an exception.

like image 62
hephalump Avatar answered Apr 27 '26 16:04

hephalump