Nerdy Drunk

Drunk on technology

User Tools

Site Tools


aws:lambda:python

AWS Lambda Python General

General tips that don't really fit anywhere else.

Custom Environment

Create virtual environment.
python3 -m venv ENVIRONMENTNAME

Enter and activate virtual environment.
cd ENVIRONMENTNAME/lib/python3/site-packages
source ../../../bin/activate

Install dependencies and create and test code.
python3 -m pip install DEPENDENCY
vim CODE.py
python3 CODE.py

Cleanup and create zip.
python3 -m pip uninstall setuptools pip
zip -r ../LAMBDA.zip *

Now you can create your lambda function and upload the zip file. Also remember to update the handler to call your primary .py file and initial function.

aws/lambda/python.txt · Last modified: 2022/07/21 10:41 by 127.0.0.1