Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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