Skip to content

Instantly share code, notes, and snippets.

@tonysangha
Created June 14, 2022 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonysangha/9711bb86fc9c18233436b5467cecf971 to your computer and use it in GitHub Desktop.
Save tonysangha/9711bb86fc9c18233436b5467cecf971 to your computer and use it in GitHub Desktop.
List the last 5 Ubuntu AMI Image builds in a specific AWS Region using the CLI

Find a list of Ubuntu AMI's in a specific region

aws ec2 describe-images --region us-east-1 \
 --filters Name=name,Values="ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server*" \
 --query 'Images[*].[ImageId,CreationDate,Description]' --output text \
 | sort -k2 -r \
 | head -n5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment