How can I invoke an AWS Lambda regularly, specifically every 1 minute?
The current functionality allows Lambdas to be setup with 5 minute trigger, but I am looking for a much lesser time interval.
I thought of running the Lambda forever, but it looks like that can't be done since the
Maximum execution duration per request 300 seconds
Under Targets, Choose Add target, On the dropdown menu, select the preferred Lambda function, For Function, Select the function name. For Configure details, Under the Rule definition, enter a name for the rule and then provide a short description. State should be Checked (Enabled).
Lambda uses the 3,000 available burst concurrency to create new environments to handle the additional load. 1,000 requests are throttled as there is not enough burst concurrency to handle all 5,000 requests. Transactions per second are 16,000.
[Removed previous answer and update] Now, AWS Lambda provides a per minute frequency CloudWatch Events - Schedule as a trigger option.
There was a session at AWS Reinvent in 2015 that covered this exact topic, you can watch it here on youtube: https://www.youtube.com/watch?v=FhJxTIq81AU shows how to use lambda and cloudwatch to get that 1 minute frequency with no external dependencies.
Do you need to run an AWS Lambda function on a schedule, without an event to trigger the invocation? This session shows how to use an Amazon CloudWatch metric and CloudWatch alarms, Amazon SNS, and Lambda so that Lambda triggers itself every minute—no external services required! From here, other Lambda jobs can be scheduled in crontab-like format, giving minute-level resolution to your Lambda scheduled tasks. During the session, we build this functionality up from scratch with a Lambda function, CloudWatch metric and alarms, sample triggers, and tasks.
I suspect that at some point AWS will allow the 1 minute interval without using this method, but this may hold you over in the mean time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With