Skip to content

Instantly share code, notes, and snippets.

@blindman2k
Created April 1, 2020 11:14
Show Gist options
  • Save blindman2k/b46d7777f1dc75e27756c2f61a628d04 to your computer and use it in GitHub Desktop.
Save blindman2k/b46d7777f1dc75e27756c2f61a628d04 to your computer and use it in GitHub Desktop.
Download all AWS Lambda functions in the account
# Serially download all aws-lambda functions
# Assumes you have ran `aws configure` or have the AWS_DEFAULT_PROFILE variable set
# Works with "aws-cli/1.16.72 Python/3.6.7 Linux/4.15.0-42-generic botocore/1.12.62"
mkdir -p lambda_functions
for fn in $(aws lambda list-functions --output text --query "Functions[*].FunctionName" | xargs);
do
echo "Downloading function $fn ..."
aws lambda get-function --function-name $fn --output text --query 'Code.Location' | xargs wget -q --show-progress -O ./lambda_functions/$fn.zip
done
echo "Completed Downloading all the Lamdba Functions!"
# If you want to download only ones with specific prefix
# https://github.com/sambhajis-gdb/download_all_lambda_function/blob/master/get_lambda_with_prefix.sh
# Credits to https://stackoverflow.com/users/6908140/sambhaji-sawant for the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment