Download all of your Lambda functions from AWS using this Bash script
download_lambda () {
echo "Downloading $1..."
local funcName=$1
aws lambda get-function --function-name $funcName --query 'Code.Location' | xargs wget -O ./lambda_functions/$funcName.zip
}
mkdir -p lambda_functions
for fnName in $(aws lambda list-functions | grep -Poh '(?<="FunctionName": ")[-\w]+' | xargs);
do
download_code "$fnName"
done
echo "Completed downloading all Lamdba Functions."
Leave a Reply