How to access files on s3 from lambda using filepath and not url

0

I know this may be a weird question to ask, but i'd ask it anyway. I have a lambda function that's meant to convert some video files in a folder in an s3 bucket to audio files. My method of conversion (Moviepy library with python) requires me to provide the path to the files to be converted and a path to where the converted should be saved. So far i know s3 gives me s3://mybucket/Videos/12345.mp4 but this won't work with the library i am converting with. So i want to know if it possible for me to mount my s3 so i can access files directly like mnt/mybucket/videos/12345.mp4

**Disclaimer: ** i know i can use an EFS but these files are already saved on s3. I also know i can download these files to my lambda runtime environment and access them like i would have done offline, but i want to know if there is a way i can do this like i have described.

已提问 2 年前1522 查看次数
2 回答
0

Short answer: No.

You could stand up a Storage Gateway in a VPC and mount S3 that way but it probably not be cost effective.

What's stopping you from copying the file to the /tmp directory in your Lambda function and operating on it there? You can increase the size of the storage in /tmp - again, for a fee but it's less expensive to do it that way.

profile pictureAWS
专家
已回答 2 年前
  • Thank you, i will try the /tmp way. I just felt they'd be a different way

0

Hello

How big are the files and how often do you process them?

S3 doesn't provide a file interface to access the buckets natively. There are two ways that come to mind using AWS services. One you already mentioned (download method). Other option is to use FSx Lustre and link it to S3 bucket. Here are some references that detailed the integration: https://aws.amazon.com/blogs/aws/enhanced-amazon-s3-integration-for-amazon-fsx-for-lustre/ https://aws.amazon.com/fsx/lustre/ https://docs.aws.amazon.com/fsx/latest/LustreGuide/create-dra-linked-data-repo.html

You can deploy FSx for Lustre in Scratch or Persistent mode. https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html

AWS
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容