Last active
October 10, 2024 08:43
-
-
Save nemani/defdde356b6678352bcd4af69b7fe529 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
# Parallelly download all aws-lambda functions | |
# Assumes you have ran `aws configure` and have output-mode as "text" | |
# Works with "aws-cli/1.16.72 Python/3.6.7 Linux/4.15.0-42-generic botocore/1.12.62" | |
download_code () { | |
local OUTPUT=$1 | |
aws lambda get-function --function-name $OUTPUT --query 'Code.Location' | xargs wget -O ./lambda_functions/$OUTPUT.zip | |
} | |
mkdir -p lambda_functions | |
for run in $(aws lambda list-functions | cut -f 6 | xargs); | |
do | |
download_code "$run" & | |
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
The original script worked for me on a Mac M1, ...BUT it deleted all the Lambda functions on AWS after downloading them.