- Navigate to the location of the Makefile
- Invoke the ziplayer function
make ziplayer
- Use the generated .zip file as desired
- The packages are zipped up to
workspace/output/layer/lambdalayer.zip
- The packages are zipped up to
- Optional - delete the workspace directory and everything in it
Last active
February 25, 2023 14:43
-
-
Save SamTowne/9fb8e124781d231a99b53a047a46c6df to your computer and use it in GitHub Desktop.
Makefile for creating a lambda layer using venv (Unix)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: | |
echo | |
prepdirs: | |
mkdir -p ./workspace/venv/layer | |
mkdir -p ./workspace/output/layer | |
createVirtualEnv: clearenv prepdirs | |
python3 -m venv ./workspace/venv | |
createlayer: createVirtualEnv | |
./workspace/venv/bin/pip3 install -t ./workspace/venv/layer/python3 boto3 | |
./workspace/venv/bin/pip3 install -t ./workspace/venv/layer/python3 aws-xray-sdk | |
ziplayer: creatlayer | |
zip -r9 ./workspace/output/layer/lambdalayer.zip ./workspace/venv/layer/python3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment