We're trying to have a lambda on AWS, that is scheduled to run every Monday at 9:45am.
Our cron expression is in the form of:
cron(45 9 ? * MON *)
AWS docs explicitly state, that you there are six required fields for the crons (you can ignore seconds) - see documentation here: https://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html
However, deploying the lambda results in an error:
An error occurred: ConsumerEventsRuleSchedule13 - Parameter ScheduleExpression is not valid.
(Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException)
I've managed to fix it, by adding seconds to the expression:
cron(0 45 9 ? * MON *)
However, I'm still confused why the original expression was invalid?
AWS documentation (linked above) even provides a working expression for a task running every work day (Monday - Friday):
cron(0 18 ? * MON-FRI *)
which looks just like what we tried to use originally, minus the weekday range (since we want one specific weekday).
Any clues?