Created
November 11, 2022 19:04
-
-
Save RaphaMiranda/09a0a139d16e1f100cff4d7efdc529d0 to your computer and use it in GitHub Desktop.
Script Shell for download matching lambda functions from aws to local machine. This script can run on git-bash terminal on windows
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
#!/usr/bin/env bash | |
#You need to have aws-cli installed and configured | |
#Credits to Reddit user u/aa93 for the suggestions | |
mkdir -p code | |
aws lambda list-functions | \ | |
grep FunctionName | \ | |
#Select only matching prefix functions | |
#grep <prefix> | \ | |
cut -d '"' -f4 | \ | |
while read -r name; do | |
aws lambda get-function --function-name $name | tee ./code/$name.json | egrep -o 'https?://[^ ]+' | sed 's/"//' | xargs curl --output ./code/$name.zip | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment