ScheduleEventSource
Source:
src/AWS/Lambda/ScheduleEventSource.ts
Lambda runtime implementation for AWS.Scheduler.consumeSchedule(...) —
the “cron handler” DX where a Lambda consumes its own EventBridge Scheduler
invocations.
This layer does two things:
- At deploy time it creates the backing
Scheduletargeting the current Lambda function, plus the synthesized execution role that allows EventBridge Scheduler to invoke it. - At runtime it matches incoming Lambda events against the schedule’s
typed envelope (
isScheduleEvent+ the stable route id) and dispatches them to the supplied handler.
Consuming Scheduled Invocations
Section titled “Consuming Scheduled Invocations”Run A Handler Every 5 Minutes
yield* AWS.Scheduler.consumeSchedule( AWS.Scheduler.every("5 minutes"), (event) => Effect.log(`fired at ${event.scheduledTime}`),);Nightly Cron With An Explicit Route Id
yield* AWS.Scheduler.consumeSchedule( "NightlyCleanup", AWS.Scheduler.cron("cron(0 3 * * ? *)"), (event) => Effect.log(`cleanup ${event.executionId}`),);