Skip to content

Instantly share code, notes, and snippets.

@doi-t
Last active April 14, 2022 11:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doi-t/1e9b7005fd37130e83ac136475eba1a6 to your computer and use it in GitHub Desktop.
Save doi-t/1e9b7005fd37130e83ac136475eba1a6 to your computer and use it in GitHub Desktop.
List up all Amazon Linux AMI (HVM / 64-bit) IDs
aws ec2 describe-images --owners self amazon --filters \
Name=virtualization-type,Values=hvm \
Name=architecture,Values=x86_64 \
Name=block-device-mapping.volume-type,Values=gp2 \
| jq -r '.Images | sort_by(.Name)| .[] | select(.Platform != "windows") | .Name + ": " + .ImageId' \
| egrep 'amzn-ami-hvm|ecs-optimized|amzn2-ami-hvm|amzn2-ami-ecs'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment