AWS Enables S3 Bucket Mounting for Lambda
- •AWS launched S3 Files, enabling direct mounting of S3 buckets as local file systems in Lambda.
- •The system replaces manual boto3 object management with native file path operations for improved efficiency.
- •A serverless code review system demonstrates shared workspace functionality using agents and Amazon Bedrock.
AWS has introduced S3 Files, a feature allowing developers to mount S3 buckets directly as local file systems within Lambda functions. This development eliminates the need for manual object downloading and uploading to the /tmp directory, which historically imposed a 10GB storage limit and required excessive boilerplate code. By using local file paths, functions can now perform read and write operations using standard language libraries like Python's open().
Under the hood, S3 Files leverages Amazon EFS (a managed network file system) to provide sub-millisecond latency for active data, while caching working sets on high-performance storage. While the feature requires the Lambda function to operate within a VPC (a private virtual network) with a NAT gateway for outbound connectivity, the architectural trade-off provides simplified file-based coordination for serverless workflows.
To demonstrate the utility of this update, a serverless code review system was built to analyze GitHub repositories. In this configuration, a durable orchestrator function clones a repository into a shared S3 Files workspace, allowing parallel security and style review agents to operate on the same data without passing S3 keys between functions. The agents use the Strands Agents SDK and Amazon Bedrock (a managed service for building generative AI applications) to analyze code and write results back to the shared file system.
Implementation requires five specific resources: an S3 bucket with versioning, an IAM role, an S3 Files FileSystem, network mount targets, and an access point to define POSIX identities. Users must ensure that the access point is configured with proper CreationPermissions to allow Lambda to write to the root directory. Because S3 Files utilizes close-to-open consistency, developers should design workflows that avoid simultaneous concurrent writes, such as utilizing an orchestrator to manage task ordering. The implementation confirms that VPC-attached Lambda functions maintain efficient performance, with cold start times reported under 2 seconds even with the file system mount enabled.