I am writing AWS Lambda functions for my android app backend. I have multiple Lambda functions in python on AWS which requires the same libraries. For example, I need to access the database so I use pymysql library in all my lambda functions. But I am not sure whether I am doing it right.
Do I have to include these libraries in every function package that I deploy or is there a better way by which I can reference the libraries I have used in the previous function?
I am following Tutorial: Accessing Amazon RDS in an Amazon VPC. I have 2 functions. I am uploading each function separately with its dependencies in a zip. Zip contains the code and libraries. Libraries takes most of the space making zip size big. Now the second function also requires the same libraries so again making a zip with same libraries feels wrong.
Also some links to where this is mentioned in docs is helpful. I did not find it anywhere in documentation.