Home > OS >  Terraform AWS - ScheduleExpression is not valid
Terraform AWS - ScheduleExpression is not valid

Time:06-23

I am trying to create a resource

resource "aws_cloudwatch_event_rule" "foo" {
  ..
  schedule_expression = "cron(*/5 * * * * *)"
}

And I want it to run every 5 minutes. Terraform says this expression is not valid:

ValidationException: Parameter ScheduleExpression is not valid.

What am I doing wrong?

Note that I don't want to use rate(5 minutes) because I want it to run at minutes which are multiplies of 5 (00, 05, 10, 15, 20, [...], 55).

CodePudding user response:

It should be:

cron(*/5 * ? * * *)

enter image description here

  • Related