Skip to content

Instantly share code, notes, and snippets.

@phoolish
Last active April 19, 2016 00:20
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 phoolish/76cb20b7a34d82f659aca74702b7e9d7 to your computer and use it in GitHub Desktop.
Save phoolish/76cb20b7a34d82f659aca74702b7e9d7 to your computer and use it in GitHub Desktop.
list aws linux hvm ebs ami's
#!/bin/bash
# Requires aws-cli and jq to be installed
#
# Returns the name and ami for each release that matches
aws ec2 describe-images --owners amazon --filters Name=virtualization-type,Values=hvm | jq '[.Images[] | select(.Name | startswith("amzn-ami-hvm")) | select(.Name | endswith("ebs")) | { name: .Name, ami: .ImageId } ] | sort_by(.name)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment