Skip to content

Instantly share code, notes, and snippets.

@medwig
Created June 26, 2019 12:12
Show Gist options
  • Save medwig/0357efd48bb83ec35bb1fba1fc693d06 to your computer and use it in GitHub Desktop.
Save medwig/0357efd48bb83ec35bb1fba1fc693d06 to your computer and use it in GitHub Desktop.
Download AWS lambda function package cli
#!/usr/bin/env bash
# Download AWS lambda function package
# Add to ~/.bashrc
getLambda() {
functionName=$1
awsProfile=${2:-default}
echo "Getting lambda function $functionName on account $awsProfile"
aws lambda get-function --function-name $functionName --query 'Code.Location' --profile $awsProfile |
xargs wget -O lambda.zip
unzip lambda.zip -d $functionName
rm lambda.zip
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment