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개 답변
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠