AWS Lambda python Workaround for "Deployment package is too large to enable inline code editing"

I'm writing AWS Lambda in python. When I put the package and upload it with ZIP, the message "Deployment package is too large to enable inline code editing" is displayed and inline code editing cannot be used. Here's how to avoid this. Register with the AWS Lambda layer separately for the package. 1.PNG

Method

1. Put the python packages together in a folder

pip install xxx -t ./python/

If you write as above, the packages will be organized in a folder called python.

2. Upload to AWS Lambda layer

2.PNG Zip up the python folder and upload it.

3. Select a layer with the AWS Lambda function

3.PNG Select the layer you just saw. Now Lambda only needs the main python file.

Afterword

This article is short, but that's it. Inline code editing is super convenient. I wrote locally for 2 years and uploaded a ZIP file. I should have noticed earlier.

Recommended Posts

AWS Lambda python Workaround for "Deployment package is too large to enable inline code editing"
[For Python] Quickly create an upload file to AWS Lambda Layer
ImportError when trying to use gcloud package with AWS Lambda Python version
Connect to s3 with AWS Lambda Python
A story about cross-compiling a python package for AWS Lambda and deploying it serverless
[AWS / Lambda] How to load Python external library
Summary of studying Python to use AWS Lambda
How to use pip, a package management system that is indispensable for using Python