• Skip to primary navigation
  • Skip to main content

Josh Withee

  • Home
  • Blog
  • Contact
  • Show Search
Hide Search

How To Download All Lambda Functions From AWS Using Bash

Josh Withee · July 23, 2022 · Leave a Comment

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."

Related

Uncategorized AWS, Bash, Lambda

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023