Monday, February 5, 2024

[SOLVED] AWS Eventbridge rule to run twice a day Monday through Friday

Issue

I am trying to setup an Eventbridge rule through Terraform that would run twice a day (6AM and 8PM) Monday through Friday. However, I have not had luck doing that. Below is what I have tried so far:

schedule_expression = cron(0 0 6,20 ? * MON-FRI *)

I am getting this error: Parameter ScheduleExpression is not valid.

Can anyone suggest what is wrong in this expression?


Solution

EventBridge cron expressions follow: cron(minutes hours day-of-month month day-of-week year)

You have too many parameters, the expression you're looking for is:

cron(0 6,20 ? * MON-FRI * )


Answered By - Thomas
Answer Checked By - Clifford M. (WPSolving Volunteer)