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 ?

質問済み 4年前1165ビュー
1回答
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 **)

回答済み 4年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ