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

- 1,484
- 1
- 19
- 33

- 10,185
- 11
- 77
- 104
4 Answers
[Removed previous answer and update]
Now, AWS Lambda provides a per minute frequency CloudWatch Events - Schedule as a trigger option.

- 10,185
- 11
- 77
- 104
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.

- 45,870
- 7
- 88
- 116
-
I will try that and see if that works for me. Thanks – Chenna V Feb 08 '16 at 15:26
Adding another approach/solution:
We can use AWS EventBridge to trigger a Lambda in particular intervals.
Doc -> https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-run-lambda-schedule.html
YouTube -> https://www.youtube.com/watch?v=uUhEKtLrGvo

- 471
- 2
- 11
Using the boto module, you can have a lambda function run an invoke statement, invoking itself. The following will run every ~60 seconds. Of course make sure you assign an appropriate role with permissions. Also, note your limits.
import boto3,time
def lambda_handler(event, context):
#do something
time.sleep(60)
client = boto3.client('lambda')
response = client.invoke(FunctionName='YOUR-FUNCTION-NAME')

- 46,058
- 19
- 106
- 116