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


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.

demandé il y a 2 ans1681 vues
2 réponses

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
répondu il y a 2 ans
  • Thank you, i will try the /tmp way. I just felt they'd be a different way



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:

You can deploy FSx for Lustre in Scratch or Persistent mode.

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions