Serverless: Cron syntax rejected

Created on 24 Nov 2016  路  3Comments  路  Source: serverless/serverless

This is a Bug Report

Description

In serverless.yml, for one function, my events section is this:

        events:
            - schedule:
                rate: cron(55 7-23 * * * *)

When I attempt to deploy, I get this error:

  Serverless Error ---------------------------------------

     An error occurred while provisioning your stack: AlertEventsRuleSchedule1
     - Parameter ScheduleExpression is not valid..

This AWS doco page seems to indicate this syntax is OK:
http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html

Additional Data

  • Serverless Framework Version you're using: 1.1.0
  • Operating System: OSX Sierra
bug

Most helpful comment

Hey @chris-hailstorm

cron expression is wrong, because

You can't specify the Day-of-month and Day-of-week fields in the same Cron expression. If you specify a value in one of the fields, you must use a ? (question mark) in the other.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions

Closing as it's not an issue.

All 3 comments

The same error results when the final "*" is removed

Thanks for reporting @chris-hailstorm 馃憤

This issue is related to https://github.com/serverless/serverless/issues/2344

Hey @chris-hailstorm

cron expression is wrong, because

You can't specify the Day-of-month and Day-of-week fields in the same Cron expression. If you specify a value in one of the fields, you must use a ? (question mark) in the other.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions

Closing as it's not an issue.

Was this page helpful?
0 / 5 - 0 ratings