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 ?

feita há 4 anos1165 visualizações
1 Resposta
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 há 4 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas