aws-samples / aws-secrets-manager-rotation-lambdas

Contains Lambda functions to be used for automatic rotation of secrets stored in AWS Secrets Manager
MIT No Attribution
329 stars 282 forks source link

Updating python enginefrom 3.7 to 3.11 Runtime.ImportModuleError #120

Open felixekwoge opened 1 year ago

felixekwoge commented 1 year ago

[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'pymssql._pymssql' Traceback (most recent call last)

jbct commented 1 year ago

Hi felix. We've been tracking a similar problem with the PostgreSQL library. Can you take a look at this article and see if it helps with the pymssql library? This is caused by the underlying C library being compiled with runtimes from an older Python library and thus not compatible with the newer versions.

https://repost.aws/knowledge-center/secrets-manager-lambda-rotation

qswinson commented 1 year ago

The Python 3.7 lambda runtime will begin deprecation on November 27, 2023. After that date, new lambdas cannot be created with Python 3.7. Will these examples be updated for a current python version?

https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

jbct commented 1 year ago

Hi @qswinson - we don't distribute the Python libraries here. If you deploy new versions through Lambda's Serverless Application repo, choosing one of our rotation projects, they deploy with the 3.9 runtime.