Zappa
Zappa copied to clipboard
Schedule tasks with `cron()` format need to follow AWS rules
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
- Set a schedule task using standard cron syntax:
"events": [{
"function": "myapp.callable",
"expression": "cron(15 * * * ? *)"
}]
- Deploy the branch
- See error
Your Environment
- Zappa version used: 0.52.0
- Operating System and Python version: OSX, Python 3.8.6
I've referenced the issue in a pull request with some suggested changes to the docs.