Last active
October 31, 2019 03:10
-
-
Save zynaxsoft/eeee5222636de23a6a746b29da7ec484 to your computer and use it in GitHub Desktop.
deploy lambda
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
#!/bin/bash | |
set -e | |
FUNCTION_NAME="tanapol_test" | |
source .env/bin/activate || python3.7 -m venv .env;source .env/bin/activate | |
python3 --version | |
pip3 install -r requirements.txt | |
deactivate | |
cd .env/lib/python3.7/site-packages | |
zip -r9 ${OLDPWD}/function.zip . | |
cd ${OLDPWD} | |
zip -g function.zip lambda_function.py | |
echo "Uploading..." | |
aws lambda update-function-code --function-name ${FUNCTION_NAME} --zip-file fileb://function.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
This script assumes that you have set up
awscli
firsthttps://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
Also awscli is already configured by
aws configure