Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::Events::Rule ScheduleExpression: "cron(* 1 * * * *)" #1351

Closed
jtheuer opened this issue Feb 11, 2020 · 3 comments · Fixed by #1405
Closed

AWS::Events::Rule ScheduleExpression: "cron(* 1 * * * *)" #1351

jtheuer opened this issue Feb 11, 2020 · 3 comments · Fixed by #1405
Labels
new rule New rule

Comments

@jtheuer
Copy link
Contributor

jtheuer commented Feb 11, 2020

cfn-lint version: (cfn-lint 0.27.5)

Description of issue.

  EventRule:
    Type: "AWS::Events::Rule"
    Properties:
      ScheduleExpression: "cron(* 1 * * * *)" 
      State: "ENABLED"
      Targets:
        - Arn: !Ref Foo
          Id: "Foo"
          RoleArn: !GetAtt FooArn.Arn

Check should be probably in:

src/cfnlint/rules/resources/events/RuleScheduleExpression.py

The above ScheduleExpression is invalid (need a value for minute if hour is set). For example cron(0 1 * * ? *)


Schedule Expressions for Rules documentation

@kddejong
Copy link
Contributor

kddejong commented Mar 7, 2020

@jtheuer I can get * 1 * * ? * to work. Are you getting an error in this situation? I'm seeing this in the documentation.

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

Which was also corrected in your example and seems like an easy rule we can write. Thoughts?

@jtheuer
Copy link
Contributor Author

jtheuer commented Mar 9, 2020

Hi @kddejong Yes, * 1 * * ? *is correct. The example from the CF snippet above is invalid but didn't raise an error. Thanks for tackling this.

@PatMyron
Copy link
Contributor

main issue for AWS::Events::Rule.ScheduleExpression: #816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new rule New rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants