Simple script to download all AWS Lambad functions in a given region
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
#!/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