I have a lambda function configured in serverless to run on a schedule as follows:
runDailyBatch:
handler: src/handlerRunDailyBatch.handler
timeout: 20
reservedConcurrency: 1
memorySize: 128
events:
# Min, Hr, Day-of-month, Month, Day-of-week, Year
- schedule:
name: "api-data_pipeline_runner-${opt:stage}-daily"
method: scheduler
rate: cron(*/3 * * * ? *)
# TODO: rate: cron(10 2 * * 1-6 *)
timezone: Europe/London
input:
cause: 'daily'
alarms:
- name: functionErrors
nameTemplate: "$[functionName]_function_errors"
lambdaInsights: true
If I remove the “method: scheduler” and timezone elements it works but then it’ll be executing at the wrong time when we hit DST (note that the every-3-minute times are just for testing purposes) which is clearly undesirable.
I believe I’ve followed there instructions at https://www.serverless.com/framework/docs/providers/aws/events/schedule#:~:text=key2%3A%20value2-,Use%20AWS%3A%3AScheduler%3A%3ASchedule%20instead%20of%20AWS%3A%3AEvent%3A%3ARule,-Note%3A%20scheduler correctly but it doesn’t work.
I see the schedule under Eventbridge schedules correctly but no trigger on the lambda and then lambda never executes.
What am I missing? Permissions? If so, why’s there no error reported anywhere?