Serverless framework - schedule rate "cron" not yet supported

Viewed 667

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?

2 Answers

use rate format !

- schedule: rate(1 minute)

1.install serverless-offline-scheduler npm package

  1. And add the same plugin to your serverless.yml file

plugins:

  • serverless-webpack
  • serverless-offline
  • serverless-offline-scheduler
Related