Created
October 12, 2019 19:00
-
-
Save mshakhomirov/ee26eadb038ff2c2aba06e79de9b1007 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# chmod +x the_file_name | |
base=${PWD##*/} | |
zp=$base".zip" | |
echo $zp | |
rm -f $zp | |
zip -r $zp * -x deploy.sh | |
if ! aws lambda create-function \ | |
--function-name gcs-transfer \ | |
--description "Sync files from S3 to Google Cloud Storage" \ | |
--handler index.handler \ | |
--runtime nodejs8.10 \ | |
--role arn:aws:iam::1234567890:role/your_role_dataload_lambda \ | |
--zip-file fileb://$zp; | |
then | |
echo "" | |
echo "Function already exists, updating instead..." | |
aws lambda update-function-code \ | |
--function-name gcs-transfer \ | |
--zip-file fileb://$zp; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment