Purpose: Connect to MS SQL Server in AWS Lambda
Error from AWS Lambda:
START RequestId: 37951004-404b-11e7-98fd-5177b3a46ec6 Version: $LATEST
module initialization error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)")
END RequestId: 37951004-404b-11e7-98fd-5177b3a46ec6
My approach:
referring to
Tesseract OCR on AWS Lambda via virtualenv
- UnixODBC and ODBC 13 driver for SQL Server installed in aws ec2 instance
- Created a deployment package (i.e.
pip install -t pyodbc /home/ec2-user/lambdaand copied the corresponding files to zip root ) mkdir liband copied all shared libraries by viewing ldd pyodbc.so*ldd libmsodbcsql-13.0.so.1.0- change
LD_LIBRARY_PATHto libin lambda.py and load the zip in Lambda
Zip file structure:
.
+
+
+
+
| +
My guess:
From the answer it seems that everything is working fine, except that the unixODBC manager cannot find the driver in AWS Lambda Instance
Question:
AWS Lambda? ODBC libmsodbcsql-13.0.so.1.0?
unixODBC ./configure --prefix=/home/ec2-user/lambda --libdir=.. odbcinst.ini, .
(, - python, , )