Skip to content

Instantly share code, notes, and snippets.

@juliosmelo
Created December 30, 2019 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliosmelo/d6543a45508dbed5ee94d21f61a790df to your computer and use it in GitHub Desktop.
Save juliosmelo/d6543a45508dbed5ee94d21f61a790df to your computer and use it in GitHub Desktop.
Simple script to download all AWS Lambad functions in a given region
#!/bin/bash
aws_region='us-east-1'
functions=$(aws lambda list-functions --region us-east-1 | jq -r '.Functions[].FunctionName')
for function in $functions; do
datetime=$(date)
echo "[$datetime] Downloading Lambda $function"
function_url=$(aws lambda get-function --function-name $function --query 'Code.Location' --region $aws_region)
url=$(echo $function_url | tr -d '"')
wget -O $function.zip $url
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment