I have a Lambda with 30 versions. I want to delete Lambda versions 1-25 inclusive.
How can I do this using the AWS CLI?
This deletes all Lambda versions from 1 to 25.
It loops inclusively over the 1-25 range & executes aws lambda delete-function appending the version number to the function name, indicating the specific version to be deleted.
Substitute MyLambdaFunctionName for your function name.
functionName='MyLambdaFunctionName'
for i in {1..25}
do
echo "Deleting $functionName version $i"
aws lambda delete-function --function-name $functionName:$i
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With