Create a Zip archive using macOS Terminal
Two popular ways to package files for AWS Lambda.
This example shows how to recursively compress files into a zip folder and exclude items such as
-r Recursively include all files within folder
-x "package.json" means to exclude any files with this name
.* means to exclude any hidden files such as
-x *.md means to exclude anything with a
zip -r my_zip_package * -x .* -x "package.json" -x "*.md"
unzip my_zip_package.zip -d /path/to/directory
Now that we've gone over the basic commands, our next step should be to create scripts that can help us automate the process of packaging and publishing our code to Lambda.
My article on Managing AWS Commands using JakeJS will show you how I package all of my Lambda functions for deployment into a single script.