简体   繁体   中英

way to package python lambda python files with no requirements.txt

Is there a way to package lambda files that do not have requirements.txt? For using docker or other methods we need to have requirements.txt. Please share ur opinions !

Yes, at a minimum you just need to zip the code. If the handler function is in a file named my_lambda.py, then your zip needs to have this file at the root. If your code has 3rd-party dependencies, you must add them to the zip yourself--they won't get automatically installed by Lambda.

Check out

Also, you may want to consider using Lambda Layers: https://medium.com/@adhorn/getting-started-with-aws-lambda-layers-for-python-6e10b1f9a5d

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