VS Code Server (code-server) on AWS Lambda MicroVMs

AWS Lambda MicroVMs

Deploy VS Code Server (code-server) inside AWS Lambda MicroVMs for a full browser-based IDE running in an isolated sandbox.

This pattern deploys VS Code Server (code-server) inside Lambda MicroVMs, giving you a full IDE accessible from your browser running in an isolated Firecracker sandbox.
The Lambda MicroVM image is built declaratively via CloudFormation using the AWS::Lambda::MicrovmImage resource. During the build, Lambda executes the Dockerfile server-side (installs code-server, Python, AWS CLI), waits for the /ready lifecycle hook on port 9000, and takes a snapshot for sub-second resume.
Lifecycle hooks (run, suspend, resume, terminate) on port 9000 manage the MicroVM state transitions — enabling graceful suspend/resume without losing IDE state. The VM auto-suspends after idle and resumes on demand.
A local Python proxy (proxy.py) injects the auth token header so your browser can reach the MicroVM endpoint over HTTP and WebSocket, giving you a seamless VS Code experience.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-microvms-code-server

Deploy

pip3 install aiohttpexport ACCOUNT_ID="YOUR-ACCOUNT-ID"export AWS_REGION="YOUR-ACCOUNT-REGION"chmod +x deploy.shbash deploy.sh


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

See Cleanup section in README.md

Created by:

Ricardo Marques

Ricardo Marques

Sr Serverless Specialist, AWS

Follow on LinkedIn