4

my app does some http request and insert the result into sql server db on daily basis. sql server is on amazon's rds service, i use default-vpc settings.

When i try to use it in aws lambda (packaged as it defined on the aws-lambda documentation), it gives following error:

module initialization error: 'ODBC Library is not found. Is LD_LIBRARY_PATH set?'

I use pypyodbc as python mssql module.

Do i need to setup odbc library manually?

Attached role includes the policiy:

  • AWSLambdaVPCAccessExecutionRole

Edit: i tried to use ceodbc and pyodbc, unable to find module "" error raised. (installed in virtualenv with ceodbc whl file, pyodbc with pip) NOTE: those two has .pyd file extensions in root level, since they are also in the site-packages folder. I guess amazon lambda doesn't include pyd file while executing.

Edit2: followed these steps, got same error. https://docs.aws.amazon.com/lambda/latest/dg/vpc-rds-create-rds-mysql.html

1 Answer 1

0

It doesn't seem to be a VPC problem, but more a problem of package that is not in the lambda.

In python, the best way is to install your packages in your lambda folder before compressing all in the .zip : $ pip install YOUR_MODULE -t YOUR_LAMBDA_FOLDER

(And I don't know pypyodbc but pymsql is working for me.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.