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 ?

gefragt vor 4 Jahren1165 Aufrufe
1 Antwort
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 **)

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen