About folder structure when uploading Python module to Lambda Layer

Introduction

When I tried to use Lambda Layer, I was addicted to the folder structure of the Python module, so I will write it as a reminder. For Lambda Layer, please refer to AWS Official Document.

Folder structure

The folder structure for each programming language is also mentioned in the Official Documents. .. In case of Python, it is necessary to place the module used by Lambda Layer under `python /`. For example, the image is as follows.

python
 ├─test1.py
 └─common
   └─test2.py
 

To upload to Layer, make the above python folder into a zip file and then upload. If you ignore the above configuration and create a zip file and upload it, of course, an error will occur when using it with Lambda. At first, I was addicted to it because I didn't understand why it was an error. .. .. I regret that I have to check the document properly.

Recommended Posts

About folder structure when uploading Python module to Lambda Layer
Play with Lambda layer (python) for about 5 minutes
About the Python module venv
[AWS] Try adding Python library to Layer with SAM + Lambda (Python)
How to use Python lambda
Things to note when running Python on EC2 from AWS Lambda
[Python / AWS Lambda layers] I want to reuse only module in AWS Lambda Layers
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
[For Python] Quickly create an upload file to AWS Lambda Layer
[Introduction to Udemy Python 3 + Application] 58. Lambda
[Lambda] [Python] Post to Twitter from Lambda!
[Lambda] I tried to incorporate an external module of python via S3
python3 How to install an external module
Module to generate word N-gram in Python
Lambda function to take AMI backup (python)
How to add python module to anaconda environment
[Road to intermediate Python] Use lambda expressions
[Python] How to deal with module errors
UNHEALTHY Workspaces restart Lambda rewritten to python
About the handling of ZIP files including Japanese files when upgrading from Python2 to Python3