I'd like my Lambda function to run on the last day of every month at 11:30pm.
I'm using the Serverless Framework so all I need is the right Schedule Expression (docs here & info here)
Any help greatly appreciated.
NB: Unfortunately I can't just do it at the start of the month as there's a dependency on pulling data from a 3rd party tool that only calculates data for 'this month'.
All scheduled events use UTC time zone and the minimum precision for schedules is 1 minute. CloudWatch Events supports cron expressions and rate expressions.
Setup Cloudwatch Event Rule You can either trigger the lambda function for the fixed rate of 'n' minutes. Next, we have to add the Lambda function as a Target to this Event Rule. Under Targets, Click Add target, In the drop-down menu, choose the Lambda function, For Function, Choose the function name.
From docs:
- The L wildcard in the Day-of-month or Day-of-week fields specifies the last day of the month or week.
So, try this cron expression for 11:30 PM at the last day of the month:
cron(30 23 L * ? *)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With