'Serverless framework - schedule rate "cron" not yet supported
I am using "serverless": "^2.43.1".
I am following official docs from: https://www.serverless.com/examples/aws-node-scheduled-cron
but.. this does not seems to work at all.. All I get is:
schedule rate "cron" not yet supported!
scheduler: invalid, schedule syntax
Scheduling [my lambda name] cron: [undefined] input: undefined
Tried with official example:
functions:
myHandler:
handler: handler.run
events:
- schedule: cron(0/2 * ? * MON-FRI *)
Or even just to invoke it every minute:
functions:
myHandler:
handler: handler.run
events:
- schedule: cron(* * * * *)
but the error persist and lambda is not invoked both locally (serverless offline) and on AWS cloud
Can you help me with that?
Solution 1:[1]
use rate format !
- schedule: rate(1 minute)
Solution 2:[2]
1.install serverless-offline-scheduler npm package
- And add the same plugin to your serverless.yml file
plugins:
- serverless-webpack
- serverless-offline
- serverless-offline-scheduler
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kazuki Goda |
Solution 2 | Ashish Choudhary |