- Newest
- Most votes
- Most comments
This error is most likely coming due to lambda function is missing pymssql. Here is how you would add pymssql module to your lambda by creating a layer first:
1: Download the library onto your local environmen
pip install -t ./python pymssql
This would place the pymysql library into a folder named "python" on your present working directory.
Or
mkdir python
cd python
python3 -m pip install --upgrade pip
python3 -m pip install PyMSSQL
2: Zip the "python" folder
zip -r pymysql.zip python
3. Go to Lambda console -> in the left pane -> Additional Resources -> Layers
-
Create Layer
-
Give it a name -> Upload zip file -> Give the runtime detail, should match your lambda function run time
-
Now go to Lambda function -> Scroll down to the bottom
-
Layers -> Add Layer -> Now add the layer which you created in previous steps.
This would resolve this issue.
Hope you find this useful. Comment here if you have additional questions.
Abhishek
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 4 months ago
Just added Note to the answer.