All open source labs

Open Source

s3-files

Amazon S3 Files demo — S3 bucket mounted as POSIX file system on Lambda

JavaScript2 stars

Amazon S3 Files Demo

Minimal demo of Amazon S3 Files — a service that mounts an S3 bucket as a POSIX file system over NFS.

What it does

A SAM stack that:

  1. Creates an S3 bucket (versioning enabled — required by S3 Files)
  2. Provisions an S3 Files file system, mount target, and access point via a CloudFormation custom resource
  3. Uploads a few test files to the bucket at deploy time
  4. Mounts the file system on a Lambda function at /mnt/s3files
  5. Serves an HTML page showing ls -ltrah output — read via real POSIX file I/O over NFS

Deploy

sam build && sam deploy \
  --stack-name s3-files-demo \
  --region us-east-1 \
  --resolve-s3 \
  --capabilities CAPABILITY_IAM \
  --parameter-overrides BucketName=<your-unique-bucket-name>

The stack output includes the Lambda Function URL. Open it in a browser.

Architecture

S3 Bucket (versioned)
    └── S3 Files file system
            └── Mount target (private subnet, port 2049)
                    └── Access point
                            └── Lambda (VPC) → /mnt/s3files → HTML response

Infrastructure: VPC, private subnet, two security groups (NFS port 2049), S3 Gateway VPC endpoint, IAM roles for both the S3 Files service and Lambda execution.

Teardown

sam delete --stack-name s3-files-demo

The custom resource deletes the access point, mount target, and file system on stack deletion.

Looking for more hands-on labs?

Everything we build in the open — CLIs, libraries, and infrastructure snippets.

Browse all repositories →