1.Lambda Core Vocabulary
A Lambda function runs your handler code in a managed execution environment that goes through Init (bootstrap + your outside-handler code), Invoke (runs the handler per request), and Shutdown (cleanup) phases. Memory (128 MB–10,240 MB) also scales CPU. A version is an immutable snapshot; an alias is a mutable pointer to a version, letting you shift traffic without changing the invoker.
Key features
- Init phase: bootstrap the runtime, run code outside the handler (e.g. open a DB connection) — capped at 10 seconds on-demand
- Invoke phase: runs the handler; duration is bounded by the function timeout (1 second–15 minutes)
- Memory (128 MB–10,240 MB) also scales proportional CPU — more memory can mean faster execution, not just more headroom
- A version is an immutable, numbered snapshot of code + configuration; an alias is a mutable named pointer to a version
- Layers package shared dependencies separately from function code, attached by ARN
- Environment variables carry configuration; secrets should route through Secrets Manager/SSM rather than plain env vars
- Init — bootstrap + outside-handler code
- leads to Invoke (ready)
- Invoke — handler runs per request
- leads to Reused? (finishes)
- Reused? — warm start if yes
- leads to Invoke (yes — warm start)
- leads to Shutdown (no — eventually)
- Shutdown — cleanup, eventually
Signature
Init (once) → Invoke (per request, timeout-bound) → Shutdown
Init runs once per environment (bootstrap + outside-handler code); Invoke runs per request, bounded by timeout. Version = immutable snapshot; alias = mutable pointer callers actually target.