Stop Making Your Own AWS Lambda Layers…

…if they are already available in the AWS Serverless Application Repository.

Yann Stoneman
2 min readSep 22, 2022
Layers of multi-colored leaves or thin bread — it’s hard to tell.
Photo by Hasan Almasi on Unsplash

Have you ever added import panda as pd in your AWS Lamba function code, only to get this import module error?

import module ‘lambda_function’: No module named ‘pandas’

If you know about AWS Lambda Layers, you may be tempted to create your own.

But wait! AWS provides layers for common use cases, including for pandas running on multiple Python runtime versions.

Check out the Serverless Repo and see if what you’re looking for is there. Click on Browse all applications, and, for example, search for pandas.

Then you can either hit “Deploy,” and that layer will become available for use as a “Custom layer” when you “Add layer” in the AWS Lambda console.

Or take note of the ARN on the details page of your chosen layer and use that in your infrastructure as code.

Finally, make sure you pay attention to the author. Some layers here are published by AWS and some by 3rd parties, so use discretion in choosing which sources you trust and put the code through your own security reviews.

Share your Lambda Layers and AWS Serverless Application Repository stories in the comments!

Although I work for Amazon Web Services, this is my personal blog and the content and opinions expressed here are my own.

--

--

Yann Stoneman

Solutions Architect. 13x AWS certified. All opinions are my own. Support this blog and others by becoming a member here: https://ystoneman.medium.com/membership