Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MossabDiae/845b60f65eea91d8a2acc19e56cff7ee to your computer and use it in GitHub Desktop.
Save MossabDiae/845b60f65eea91d8a2acc19e56cff7ee to your computer and use it in GitHub Desktop.
Download All Lambda Functions
#!/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