I have an event trigger for every 5 minutes on my lambda. However, sometimes once my lambda starts running, it needs to run for longer than 5 minutes. Is there any way to have my timeout set for 15 minutes, and block the event triggers from spawning a new lambda while there is a lambda already running? Is this functionality built in?
To prevent an AWS Lambda function running in parallel, you can set the Reserved Concurrency to 1
.
While this is intended to guarantee ('reserve') capacity for the function, it also has the result of limiting concurrent executions to 1.
If the function takes longer than 15 minutes, it will probably be executed multiple times in the next 15 minute-period, which might impact your code depending on what it is expecting.