Add Lambda MicroVMs with S3 Files pattern#3206
Open
bfreiberg wants to merge 1 commit into
Open
Conversation
Mount an Amazon S3 bucket as a POSIX file system inside an AWS Lambda MicroVM (Firecracker-isolated, snapshot-resumable serverless compute) over NFS, reachable through a VPC egress network connector, with bidirectional S3 sync. CloudFormation (AWS SAM) provisions the data bucket, the S3 Files file system / mount target / access point, the VPC egress network connector, the IAM roles, the CloudWatch log group, and the MicroVM image (AWS::Lambda::MicrovmImage). A small src/run.sh helper performs the data-plane steps that have no CloudFormation resource: packaging the app artifact and launching the MicroVM (RunMicrovm). Verified end-to-end in us-west-2: deploy -> run -> bidirectional S3 Files sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AWS Lambda MicroVMs with Amazon S3 Files
Adds
lambda-microvm-s3files/— a pattern that mounts an Amazon S3 bucket as a POSIX file system inside an AWS Lambda MicroVM (Firecracker-isolated, snapshot-resumable serverless compute) over NFS, reachable through a VPC egress network connector, with changes synchronized to and from S3 in both directions.How it works
S3::Bucket(versioning on), theS3Files::FileSystem/MountTarget/AccessPoint, the NFS security group, theLambda::NetworkConnector(VPC egress), the IAM roles, the CloudWatch log group, and theLambda::MicrovmImage.src/run.shhelper performs the two data-plane steps that have no CloudFormation resource: packaging/uploading the app artifact (read by the image build) and launching the MicroVM viaRunMicrovm+ minting an auth token./runlifecycle hook (the VPC connector and execution-role credentials only exist at run time), and re-mounts on/resume.Contents
template.yaml— the SAM/CloudFormation templateexample-pattern.json— Serverless Land metadatasrc/—app.py(Flask app + lifecycle hooks),Dockerfile(AL2023 + amazon-efs-utils),run.shREADME.md— requirements, deployment, how-it-works, testing, cleanupTesting
Verified end-to-end in
us-west-2:sam deploy→run.sh run("mounted": true) →run.sh proveconfirms bidirectional sync (a file written through the mount appears in S3; a file written to S3 is read back through the mount).By submitting this pull request, I confirm that my contribution is made under the terms of the MIT-0 license.