Mount S3 File System in AWS Lambda?

2019-07-11 19:04发布

问题:

Do you know if it possible mounting a File System over AWS S3 to increase AWS Lambda storage?

回答1:

You cannot mount Amazon S3 as a filesystem for use with AWS Lambda.

AWS Lambda functions are designed to be short-running scripts that respond to an event in your environment (eg data coming into a Kinesis stream, a file being created in Amazon S3). They typically run only for a few seconds.

While you haven't described your use-case, something that requires heavy use of a filesystem is not a typically good use of a Lambda function.

You can, of course, retrieve and create objects in Amazon S3 via SDK calls from the Lambda function. This is a very fast and efficient way to load/store data from Lambda.



回答2:

The storage space provided with lambda is actually Ephemeral disk space that can be used for temporary storage during lambda execution only. It is limited to 512 Mb and can't be increased.

If your use-case needs more space for lambda than you can store and retrieve objects directly from s3 . It's highly fast and efficient. Moreover , s3 doesn't provide a file system , it is only object based storage and every folder , subfolder, and every file represents an object in s3 which virtually seems like a hierarchical structure but in actual it's not.

While the temporary disk space in lambda has a hierarchical file structure