Paramiko Python Library Setup with AWS Lambda Layer

Paramiko Setup for Python SFTP Dependency

Use Case: To set up the Paramiko library as an AWS Lambda layer 

Solution

To setup paramiko library as Lambda Layer, follow the below steps:

Step 1. Download Paramiko from https://pypi.org/project/paramiko/#files

Step 2. Extract Files in Linux > tar -xvdf paramiko-3.2.0.tar.gz

Step 3. Create a zip folder from Extracted files.

Step 4. If you got site-package, rename it with Python.

After doing this activity, create a python.zip. The folder structure should be similar to the one below.

Paramiko Python Library Setup with AWS Lambda Layer

Paramiko Python Library Setup with AWS Lambda Layer

Step 5. Go to AWS Lambda Layer, and follow the instructions mentioned in the image.

Paramiko Python Library Setup with AWS Lambda Layer

Step 6. Add a Layer to your Lambda function

Paramiko Python Library Setup with AWS Lambda Layer

FAQs

Issue. Unable to import module ‘lambda_fucntion’: No module named pysftp or Paramiko

Possible Solution

  1. See your folder structure. Please follow the folder structure mentioned in step 4.
    Paramiko Python Library Setup with AWS Lambda Layer
  2. Check your Python version; it should be python3.7

Feel free to put your query in the comment box.


Similar Articles