Schedule Lambda On Cron Expression Triggers

30 / May / 2017 by Vaibhav Gulati 1 comments

Lambda is an Amazon Web Services (AWS) masterpiece which helps in leveraging compute services for a duration of seconds to minutes and hence reduces the infrastructure costs manifolds and its maintenance.

The Cron expressions are created, evaluated and triggered using Cloudwatch Management Console. The possible cron expressions for AWS Lambda are discussed in this link. In this blog, you can see that Lambda is triggered, based on Cron expressions.

There are two ways to create Cron expressions triggers, demonstrated below.

First, go to Cloudwatch Management Console > Rules > Schedule. Specify the desired Cron expressions and Add target to a pre-created Lambda Function.

CloudWatch Rules

Second, visit Lambda Management Console > Create a Lambda function > Select Blueprint (Choose the Blueprint you want) > Configure triggers (Choose CloudWatch Events – Schedule) as following:

Lambda Triggers

Enter the Rule Name, Description, Schedule expression and then enable the trigger:

Enable-trigger

In the next stage, enter the desired Lambda Function which you need to perform. The cron expression can be validated in CloudWatch Console > Rules.

cron-cw

It will serve as a centralized place for keeping and monitoring of all the cron expressions used in the infrastructure.

Hope this blog will come in handy when you schedule Lambda On Cron Expression Triggers!

FOUND THIS USEFUL? SHARE IT

comments (1 “Schedule Lambda On Cron Expression Triggers”)

  1. Richard Clayton

    A quick note about this approach – AWS CloudWatch Rules has a limit of 100 rules (scheduled tasks) per Region per Account. Therefore, don’t think of this as an ad hoc scheduling tool.

    Reply

Leave a Reply to Richard Clayton Cancel reply

Your email address will not be published. Required fields are marked *