Reputation: 43
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?
Upvotes: 3
Views: 6671
Reputation: 6164
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.
Upvotes: 1
Reputation: 14462
Maximum execution time of Lambda function is 15 minutes (note that this is not the default value which is 3 seconds). If you are running the lambda function on schedule, every 15 minutes then the previous one has either already finished or timed out, so the answer is no, the previous instance of the lambda function is not running.
Upvotes: 0