Create an AWS Lambda Layer for Python Runtime in Windows

vishal singh
2 min readNov 3, 2023

--

In this blog post, we will show you how to create an AWS Lambda Layer for Python Runtime in Windows. This will allow you to use third-party libraries in your Lambda functions without having to install them in each function’s deployment package.

0: Open PowerShell and run this command

wsl
  1. Create a directory for your layer.
mkdir lambda-layer

2. Create a python directory inside the layer directory

cd lambda-layer
mkdir python

3. Install the libraries that you want to include in your layer. For example, to install the pandas library, you would run the following command:

pip install pandas -t . 
or
pip install pandas -t pyton

4. Zip the python directory.

zip -r pandas_layer.zip .
or
zip -r pandas_layer.zip python

5. Upload the zip file to an S3 bucket in your AWS account.

6. Create a Lambda layer in the AWS Management Console.

7. In the Create layer wizard, enter a name for your layer and select the S3 bucket and zip file that you created previously.

8. Select python run time for your AWS layer.

9. Click Create to create the layer.

10. You can now attach your layer to your Lambda functions. To do this, open the function in the AWS Management Console and go to the Layers tab click custom, and select your layer from the list and also select runtime of layer.

AWS Lambda layers are a powerful tool that can help you to develop and deploy more efficient and scalable Lambda functions.

I hope this blog post has been helpful. Please let me know if you have any questions

--

--

vishal singh

data science, SQL, Python, R, Numpy, Pandas and many more