aws-lambda-microvms

Builds, runs, and operates Firecracker-isolated MicroVMs on AWS Lambda with snapshot resume.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill aws-lambda-microvms-sakicodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-lambda-microvms
Source: https://github.com/sakicodes/BuildFestHackathon26/tree/main/.agents/skills/aws-lambda-microvms
Command: npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill aws-lambda-microvms-sakicodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Running untrusted or multi-tenant code with strong isolation, long-lived sessions, and fast startup is hard with standard serverless functions. This Skill guides you through building, running, and operating AWS Lambda MicroVMs — Firecracker-isolated compute environments that boot from memory and disk snapshots, suspend and resume with state preserved, and live up to 8 hours. ## Core Features & Use Cases - Image build and snapshot workflow: Package a Dockerfile-based app in S3, create a MicroVM image with lifecycle hooks (/ready, /validate), and launch instances that resume from snapshots in seconds. - Full lifecycle operations: Run, suspend, resume, and terminate MicroVMs via CLI, mint scoped auth tokens, and configure idle policies with auto-resume. - Networking and security: Configure ingress/egress network connectors, VPC egress, shell access via WebSocket, IAM build/execution roles, and per-token port restrictions. - Use Case: Build an AI agent code-execution sandbox where each session gets a fresh isolated MicroVM, suspends between turns to save cost, and resumes with full state intact. ## Quick Start Ask the assistant to walk you through packaging a Flask app, creating a Lambda MicroVM image, running a MicroVM, and calling its endpoint with an auth token.

Frequently Asked Questions about aws-lambda-microvms

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create and run an AWS Lambda MicroVM?

Zip your app with a Dockerfile at the root, upload to S3 in the same region, then run create-microvm-image with a managed base image and build role. Once the build succeeds, call run-microvm with the image ARN, version, and execution role to get an endpoint.

When should I use Lambda MicroVMs instead of Lambda functions?

Use MicroVMs when you need sessions longer than 15 minutes, state preserved across suspend/resume, real port-listening servers like gRPC or WebSocket, or container-level access such as FUSE and eBPF. Use standard Lambda functions for short event-driven workloads under 15 minutes.

Why do all my MicroVMs share the same UUIDs or random values?

Every MicroVM resumes from the same memory and disk snapshot, so anything generated at build time is identical across instances. Generate unique state in the /run hook or at first use, and always use CSPRNGs like Python's secrets module or Node's crypto.randomBytes.

How do I authenticate requests to a MicroVM endpoint?

Call create-microvm-auth-token with an expiration up to 60 minutes and an allowedPorts list, then send the token in the X-aws-proxy-auth header. For WebSockets from browsers, pass the token via the lambda-microvms.authentication subprotocol instead.

Why does my MicroVM return 502 errors after starting?

A 502 usually means the app is not listening on the routed port (default 8080), there is a TLS mismatch with the proxy, or the app crashed after resume. Check CloudWatch logs and verify the port with the X-aws-proxy-port header.

What are the limitations of AWS Lambda MicroVMs?

MicroVMs have a maximum lifetime of 8 hours, 16 vCPUs, and 32 GB memory, and auth tokens expire after 60 minutes. Network connectors are bound at run time and cannot change on resume, and image versions incur storage costs even when idle.