ami-search: Find latest AWS machine images

By Paul Heinlein | Jan 26, 2018

When I launch AWS EC2 instances for myself or for clients, I typically fall back on just a few OS/Distribution options: Amazon Linux, CentOS, Ubuntu LTS, or FreeBSD. I usually launch these VMs using the AWS Command Line Interface, but doing so requires the unique ID of the Amazon Machine Image (AMI) requested. I like to use the newest AMI available, but the AMI ID for the latest image changes often and the IDs vary by AWS region.

So I hacked up ami-search to list the newest images for those distributions. As it stands, the script finds the latest 64-bit, HVM- and EBS-enabled AMIs for a few distributions and prints the results to the console.