cloudtools / cloudtools/troposphere
ScheduleExpression validator doesn't validate examples provided by AWS
- Dominant language
- Python
- Stars
- 4.9k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
The following schedule expressions should pass validation (taken from [AWS docs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions)) but they raise errors upon validation with `event_schedule_expression`:
```
cron(15 10 ? * 6L 2002-2005)
cron(*/7 5-10 5 * *)
cron(5,35 14 * * ? *)
cron(0 18 ? * MON-FRI *)
cron(0/15 * * * ? *)
cron(0/10 * ? * MON-FRI *)
cron(0/5 8-17 ? * MON-FRI *)
```
```
>>> from troposphere.validators import event_schedule_expression
>>> event_schedule_expression("cron(15 10 ? * 6L 2002-2005)")
Traceback (most recent call last):
File "", line 1, in
File "troposphere/validators.py", line 375, in event_schedule_expression
% expression
ValueError: The following is not a valid expression: "cron(15 10 ? * 6L 2002-2005)"
>>> event_schedule_expression("cron(0/15 * * * ? *)")
Traceback (most recent call last):
File "", line 1, in
File "troposphere/validators.py", line 375, in event_schedule_expression
% expression
ValueError: The following is not a valid expression: "cron(0/15 * * * ? *)"
>>> event_schedule_expression("cron(0/5 8-17 ? * MON-FRI *)")
Traceback (most recent call last):
File "", line 1, in
File "troposphere/validators.py", line 375, in event_schedule_expression
% expression
ValueError: The following is not a valid expression: "cron(0/5 8-17 ? * MON-FRI *)"
```
Contributor guide
Assessment
This issue has not been assessed yet.