Configure lambda schedule event issue

I’m trying to configure scheduled event for my lambda like this:

myLambda:
  handler: ####
  description: ####
  events:
    - schedule:
      rate: rate(24 hours)

when I try to deploy it there is no error message, yet the rule is not created.
It works though if I do it like this:

myLambda:
  handler: ####
  description: ####
  events:
    - schedule: rate(24 hours)

The problem is I can’t specify the name or description for the rule.
Does anybody knows why former approach doesn’t work?
I tried to do it with different SLS versions from 1.4.0 to 1.8.0 with the same result.
Thanks!

It’s hard to tell with your message - can you please wrap your code samples with four backticks (like “````” ) so that we can see the exact whitespacing used? The most common cause of silent failures is the whitespace being wrong.

Thanks! Is it better now?

1 Like

Much!

Yep, looks like you’re missing a level of indentation on the rate line. I should look like:

myLambda:
  handler: ####
  description: ####
  events:
    - schedule:
        rate: rate(24 hours)

Great! That worked! Thanks a lot!
Didn’t realise indentation was that important