Created
December 30, 2019 18:10
-
-
Save juliosmelo/d6543a45508dbed5ee94d21f61a790df to your computer and use it in GitHub Desktop.
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