Skip to content

A python script to make a zip file with libraries for your python code.

License

Notifications You must be signed in to change notification settings

duch11/mk-aws-lambda-zip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mk-aws-lambda-zip

A python script to make a zip file with libraries for your python code.

Builds an AWS lambda deployment package. As explained here: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

Requires python to run

python3 mk_aws_lambda_zip.py

Configuring the script

# 1 Open the file
vim mk_aws_lambda_zip.py

# 2 Edit these lines

pipLibraries = ['requests']
outputFilename = "lambda.zip"
pythonCodeLocation = "python"
pipTempLocation = "tmp"

PUT THE SCRIPT 1 Directory ABOVE your lambda code

ie. source code location: C:/Code/python/my_lambda.py ( containing lambda_handler(event, context)) then Put this script here: C:/Code

Example file structure

> tree
.
├── mk_aws_lambda_zip.py <--- Put the script here
├── python  <--- Your code
│   └── utils
│       └── api  <--- any nested file structure will be preserved!
├── tmp  <--- The libraries are installed here before they are baked into the root of the zip file
│   ├── bin
│   └── (etc etc ...)
│
└── lambda.zip   <--- Resulting zip for aws lambda

About

A python script to make a zip file with libraries for your python code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages