Skip to content

Instantly share code, notes, and snippets.

View quickmute's full-sized avatar

Hyon quickmute

View GitHub Profile
@tobywf
tobywf / clean_old_lambda_versions.py
Last active June 10, 2024 14:15
A quick script to remove old AWS Lambda function versions
from __future__ import absolute_import, print_function, unicode_literals
import boto3
def clean_old_lambda_versions():
client = boto3.client('lambda')
functions = client.list_functions()['Functions']
for function in functions:
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions']
for version in versions: