When trying to create a function that is triggered from a cloudwatch rule the following works:
events:
- schedule:
rate: rate(60 minutes)
name: "my-scheduled-thing"
description: "Does a thing on a scheduled basis"
enabled: true
But this does not:
events:
- schedule:
rate: cron(0 * * * *)
name: "my-scheduled-thing"
description: "Does a thing on a scheduled basis"
enabled: true
In the latter case I get an error: “rate” property for schedule event is missing or invalid in function ScheduledDL.
The environment:
OS: win32
Node Version: 10.15.3
Serverless Version: 1.36.3
In this case it isn’t critical for me as the use of rate is acceptable (though not as ideal since cron allows me to specify the exact minute) but in many other cases this won’t be a usable trade-off.
As an additional side note, it will accept:
events:
- schedule:
rate: cron(0 * * * *)
name: "my-scheduled-thing"
description: "Does a thing on a scheduled basis"
enabled: true
But of course this isn’t properly indented so the schedule never gets created.
(edited to fix formatting)