Search code examples
pythonoracle-databaseamazon-web-serviceslambdacx-oracle

AWS python Lambda script that can access Oracle: Driver too big for 50MB limit


I must load the Oracle "instant client" libraries as part of my AWS lambda python deployment zip file.

Problem is, many of the essential libraries (libclntsh.so.12.1 is 57MB libociei.so is 105MB) and Amazon only allows deployment zip files under 50MB.

I tried: my script cannot connect to Oracle using cx_Oracle without that library in my local ORACLE_HOME and LD_LIBRARY_PATH.

How can I get that library into Lambda considering their zip file size limitation? Linux zip just doesn't compress them enough.


Solution

  • If you can limit yourself to English error messages and a restricted set of character sets (which does include Unicode), then you can use the "Basic Lite" version of the instant client. For Linux x64 that is only 31 MB as a zip file.