Skip to content

Instantly share code, notes, and snippets.

@attree
attree / cleanup.py
Created July 27, 2016 14:46 — forked from luhn/cleanup.py
An AWS Lambda function to delete old AMIs.
"""
Code adapted from and inspired by http://blog.ranman.org/cleaning-up-aws-with-boto3/.
"""
import os
import re
from datetime import datetime, timedelta
import boto3