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:
- Creates an S3 bucket (versioning enabled — required by S3 Files)
- Provisions an S3 Files file system, mount target, and access point via a CloudFormation custom resource
- Uploads a few test files to the bucket at deploy time
- Mounts the file system on a Lambda function at
/mnt/s3files - Serves an HTML page showing
ls -ltrahoutput — 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.