Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger a Lambda function at specific time in AWS?

I am aware of the CloudWatch recurring events that can be used to run Lambda recurringly.. but is there a way that I can trigger it on a certain time and not repeat?

like image 997
Faizuddin Mohammed Avatar asked Jan 31 '18 08:01

Faizuddin Mohammed


People also ask

Can Lambda be triggered by time?

So you can define an Amazon Lambda function or AWS Step Functions state machine as scheduled targets. Hence, when this event is triggered at the specified time or interval you defined, your function or state machine is executed.

Can Lambda function run periodically?

Timing events Fortunately, AWS offers such a service: the CloudWatch Event Rules. You can configure one to periodially call a Lambda function, among other potential event targets. It supports relative timing (run every 10 minutes) as well as absolute ones (run everyday at 3 a.m.).


1 Answers

Using cloud watch rules - a single non-repetitive date can be assigned.

Example cron : 0 10 16 6 ? 2019 min hours day month dayOfWeek year

This will execute once on Sun, 16 Jun 2019 10:00:00 GMT as an example.

enter image description here

Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html

like image 200
BrettKennard Avatar answered Oct 01 '22 22:10

BrettKennard