AWS Lambda with Amazon S3 Files Mount (.NET)

AWS Lambda → Amazon S3

Mount an S3 bucket as a local file system on Lambda using S3 Files for standard file operations without S3 API calls.

This pattern deploys a Lambda function with an Amazon S3 Files file system mounted at /mnt/s3data. The function performs standard file operations (read, write, list) on S3 data using the local filesystem — no S3 API calls needed.
S3 Files provides NFS access to S3 buckets with sub-millisecond latency on small files and full POSIX semantics. The pattern creates a VPC with isolated subnets (no NAT gateway), an S3 gateway VPC endpoint, S3 Files file system, mount targets, access point, and a Lambda function wired together.
Multiple Lambda functions can connect to the same S3 Files file system simultaneously, sharing data through a common workspace without custom synchronization logic.

< 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-s3-files-cdk-dotnet

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Created by:

Pankaj Rawat

Pankaj Rawat

Pankaj Rawat is a Lead Consultant at Amazon Web Services.

Follow on LinkedIn