Running a lamba event on a cron schedule to start an EC2

0

Having issues making an event trigger in the lambda console. I have it selected for Eventbrtidge (CloudWatch)|schedule expression and have added this "cron(0 3 ** ** Sun-Thu *)" to run at 03:00 UTC Sunday to Thursday, also tried variations with ? for the month, and omitting the year, all with the same response.

But I get an error "Parameter ScheduleExpression is not valid. (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID: 300a10ad-4089-4990-91d6-553274289679; Proxy: null)" when I try to add it.

I've searched all the documentation and I've found some that says to omit the cron( ) wrapper if using the lambda console, but that fails the validation entirely, I checked the cron format and it matches all formatting I can locate.

Any ideas why I'm getting the error and what to do to resolve it ?

preguntada hace 4 años1165 visualizaciones
1 Respuesta
0

Resolved this finally. The secrets are there is no seconds value in the cron, you must have the cron( ) wrapper. Day names must be all upper case, month only seems to work as ? and not **, and you must include ** for the year. Also all times are in UTC, not local zone time.

Got it working with cron(** ** 3 ? ** SUN-THU **)

respondido hace 4 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas