Forked from nemani/download_all_lambda_functions.sh
Last active
January 24, 2023 13:25
-
-
Save MossabDiae/845b60f65eea91d8a2acc19e56cff7ee to your computer and use it in GitHub Desktop.
Download All Lambda Functions
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 sh | |
# dependencies: jq (sudo apt install jq) | |
# disabled parallel downloading to keep local network / aws happy. | |
download_code () { | |
# clean double quotes if found | |
local OUTPUT=${1//\"/} | |
local dest=./lambda_functions/$OUTPUT.zip | |
local URL=$(aws lambda get-function --function-name $OUTPUT --query 'Code.Location') | |
# Using curl instead of wget | |
echo $URL | xargs curl -o $dest | |
} | |
mkdir -p lambda_functions | |
for run in $(aws lambda list-functions | jq -r .Functions[].FunctionName); | |
do | |
echo Found lambda function: $run | |
download_code "$run" | |
done | |
echo "Completed Downloading all the Lamdba Functions!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment