amazon-web-servicescronaws-lambdacronexpression

Trigger lambda function daily at a given time


I have a lambda function setup and tested via manual triggers. I want this function to run once every day at mid-day.

To achieve this I created a new CloudWatch Events - Schedule trigger with a Schedule expression of cron(0 12 ? * * *).

With the function and trigger enabled, the function was not invoked. What should the correct Schedule expression be?


Solution

  • The cron expression was correct. Remember that your AWS region may not be in the same timezone and adjust your expectations accordingly.