简体   繁体   中英

AWS Lambda Python: Can I load a file from local PC when calling my lambda?

Situation: My AWS Lambda analyze a given file and return cleaned data.

Input: path of the file given by the user

Ouptut: data dictionnary

Actually in my lambda I:

  • save the file from local PC to an s3
  • load it from the s3 to my lambda
  • analyze the file
  • delete it from the s3.

Can I simplify the process by loading in the lambda "cash memory"?

  • load it from local PC to my lambda
  • analyze the file

First of all, you might use the wrong pattern. Just upload file to S3 using AWS SDK and handle lambda with S3:CreateObject event.

No we can not directly load the file from local to Lambda or its tmp memory.

But if you want you can use a Storage gateway which automatically sink any file from a physical drive( your local pc ) into S3. This would help you to eliminate your step 1 ( save the file from local PC to an s3 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM