Lambda handler
The function in your code that Lambda calls for each event, receiving the event and a context object.
In more detail
A handler reads its input from the event, does one focused job and returns a result that can be turned into JSON. Keep handlers narrow; long workflows belong in an orchestration service such as a state machine.
Example
def handler(event, context):
return {"statusCode": 200, "body": "{}"}Related terms
- AWS Lambda — The AWS service that runs a piece of code, called a function, each time an event arrives, with no servers for you to manage.
- event — A record of something that has already happened, such as task completed, with an identifier, a time, a type and its data.
- state machine — A model in which something is always in exactly one named state, such as idle, loading, success or error, and only defined events move it to another.
Taught in
- Serverless Compute (Lambda) — Cloud Infrastructure & Hyperscaler Architecture