Skip to content

Instantly share code, notes, and snippets.

@jaga-me
Forked from jankei/deleteLambdas.sh
Last active July 5, 2018 11:01
Show Gist options
  • Save jaga-me/177420a4e4937519fdc6d63b27cbca4b to your computer and use it in GitHub Desktop.
Save jaga-me/177420a4e4937519fdc6d63b27cbca4b to your computer and use it in GitHub Desktop.
deletes old versions of lambdas that aren't aliased
#!/bin/bash
fnlist=(
'SAMPLE FUNCTION'
'ADD MORE FUNCTIONS HERE'
)
count=0
while [ "x${fnlist[count]}" != "x" ]
do
for (( i=1; i<=$1; i++ ))
do
aws lambda delete-function --function-name ${fnlist[count]} --qualifier $i
echo "lambda ${fnlist[count]} version $i was deleted"
done
count=$(( $count + 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment