AWS Lambda MicroVM from Amazon ECR image

AWS Lambda MicroVMs

Deploy an AWS Lambda MicroVM from a pre-built Docker image stored in Amazon ECR.

This pattern deploys a Lambda MicroVM from a pre-built Docker image stored in Amazon ECR. You build and push your container image to ECR, then upload a thin zip containing only a FROM directive referencing the ECR image. Lambda pulls the image during the server-side build.
This approach is ideal for complex builds, private base images, and CI/CD pipelines where you want full control over the Docker build process. MicroVMs offer snapshot-based rapid startup speeds and automatically suspend after idle timeout.

< 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-from-ecr

Deploy

bash deploy.sh


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

bash cleanup.sh

Created by:

Alexander Vladimirov

Alexander Vladimirov

Senior Serverless Solutions Architect at AWS, specializing in Agentic AI Workloads.

Follow on LinkedIn