The mental model
AWS Lambda MicroVMs is a serverless compute primitive for running user- or AI-generated code in isolated, stateful environments with explicit lifecycle control. It uses Firecracker, the lightweight virtualization technology also used by Lambda. This product is distinct from an ordinary Lambda function handler: it addresses interactive sessions that retain execution state and need managed start, suspend, resume, and termination behavior.
Snapshot startup copies initialized memory and disk state. Values that must be unique, including session identifiers, random state, or secrets, must not be baked into a shared image. Credentials and connections can expire while an environment is suspended. Refresh them through the supported lifecycle behavior, constrain the workload identity and network, and verify that state is never reused across tenants accidentally.
Decisions to make
- Compare Lambda MicroVMs for custom execution-session lifecycle control and AgentCore for a managed agent runtime.
- Keep unique session state out of shared snapshots and test credential and connection refresh after resume.
Design exercise · no AWS resources needed
Work through a scenario
A coding playground must preserve one user’s workspace while they briefly disconnect.
- Choose a per-user session mapping and a maximum session lifetime.
- Identify state that belongs in the image versus state created after startup.
- Plan suspend/resume checks, output validation, and final state destruction.
Check your understanding
Which value should be generated after a shared snapshot starts?
Choose an answer to see the reasoning.
Continue with AWS documentation
- AWS introduces Lambda MicroVMs (opens in a new tab)
- Lambda MicroVMs and snapshot considerations (opens in a new tab)
Before following a deployment guide, review current pricing, permissions, and cleanup steps. Budget alerts are not a hard spending cap.