Cron Trigger for Your Lambda function
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.
- First thing you need to do is to go to the aws console and select “CloudWatch” under Management tools,
- in the left menu under the “events” select “Rule“
- click on create “Rule“
- In the menu you will see a tick button saying “schedule” put a tick there because we are going to create schedule event
- 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
- I’ll use fixed rate and 10 minutes
- Lets add this trigger to a lambda function, click “add trigger” in right column
- 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