AWS
Imal Perera  

Cron Trigger for Your Lambda function

Spread the love

If you have already created a lambda function ( please look at the previous posts on lambda functions for more info ) that means you have already done the heavy lifting and this should be very easy for you guys, Ok lets dive in.

  1. First thing you need to do is to go to the aws console and select “CloudWatch” under Management tools,
  2. in the left menu under the “events” select “Rule
  3. click on create “Rule
  4. In the menu you will see a tick button saying “schedule” put a tick there because we are going to create schedule event
  5. now you can either select “fixed rate of” or a “cron expression”  fixed rate is for basic configurations and cron expressions are for advanced timing events. read more about cron expressions here 
  6. I’ll use fixed rate and 10 minutes
  7. Lets add this trigger to a lambda function, click “add trigger” in right column
     
  8. ok then click on next and give a name and description and we are done. 

How to view the logs ? 

go to the logs in the “cloudwatch” and select the lambda function

Leave A Comment