The Case of the Missing F5 AMI : F5 BIG-IP AMI Lifecycle Events
A customer asked me if we had anything like an Image name that would reference the most recent AMI Image. After a whole lot of digging the short answer right now is no.
A WHOLE lot more digging around and I found a way to write a query that would return the most recent AMI Image.
aws ec2 describe-images --owners 679593333241 --filters 'Name=name,Values=*BYOL-All Modules 2Boot*' --query 'reverse(sort_by(Images, &CreationDate))[:1].{name:Name,id:ImageId}' --output yaml
In this example it only returns a single AMI ID for the LATEST BYOL image that supports All Modules with Two Boot locations allowing you to do in place upgrades. The [:1] specifies that only a single record should be returned.
aws ec2 describe-images --owners 679593333241 --filters 'Name=name,Values=*BYOL-All Modules 2Boot*' --query 'reverse(sort_by(Images, &CreationDate))[:3].{name:Name,id:ImageId}' --output yaml
In this example, we expanded the results to [:3] so it will return the latest AMI images for the three major versions available right now.
You can get more specific with the strings in the Values filter if you need a different set of results.
HTH,
Carl B