Skip to main content

Posts

Showing posts with the label Serverless

EventBridge Scheduler Pitfalls: Context Attributes, Retries and Dead-Letter Design

EventBridge Scheduler is a good way to run one-off and recurring jobs, but it behaves differently from the event-driven services many teams know, such as SQS or API Gateway triggers. Most problems are not bugs. They come from assumptions about what the scheduler passes to your function, who retries a failure, and what happens to an event nobody catches. This post goes through the pitfalls in a symptom, cause and fix format. Pitfall 1: The function does not know which schedule invoked it Symptom: several schedules call the same function, and logs cannot tell them apart. Cause: the event your function receives is the input you configured on the schedule target, and nothing more. The scheduler does not add an envelope with the rule name and time like an event rule would. If you want metadata, you ask for it in the input. Fix: reference the scheduler context attributes inside the input JSON. The documented attributes are the schedule ARN, the scheduled time, an execution ID and the...