Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

Schedule tasks with `cron()` format need to follow AWS rules #2209

Open philsheard opened 3 years ago

philsheard commented 3 years ago

Context

I was deploying an update via Zappa and got an error with the ScheduleExpression.

botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the PutRule operation: Parameter ScheduleExpression is not valid.

I hadn't made changes to the task schedule the Zappa settings so I guess Amazon might have changed the requirements in their backend.

Possible Fix

Some sort of check for validity in the settings would be good, but for now just a reference to these rules in the docs might help others.

Steps to Reproduce

  1. Set a schedule task using standard cron syntax:
    "events": [{
    "function": "myapp.callable",
    "expression": "cron(15 * * * ? *)"
    }]
  2. Deploy the branch
  3. See error

Your Environment

philsheard commented 3 years ago

I've referenced the issue in a pull request with some suggested changes to the docs.