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/sh | |
## List the names of all Lambda functions. Can be constrained by using --max-items | |
for i in `aws lambda list-functions | grep FunctionName | cut -d ":" -f2 | cut -d '"' -f2` | |
do | |
echo 'Fetching code for function:' $i | |
## Using each name, get the function details and then download the zip file containing the source code. | |
aws lambda get-function --function-name $i | grep Location | awk -F' ' '{print $2}' | xargs wget -O $i.zip | |
echo 'Code downloaded to' $i.zip | |
done |