Created
February 16, 2017 04:58
-
-
Save DALDEI/36f29cf73a593c39725b1e70926f5dd2 to your computer and use it in GitHub Desktop.
Locate the latest published AWS EC2 AMI with AWS Linux, base AMI, HVM, EBS boot partition, latest kernal. 1-liner.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aws ec2 describe-images --owners amazon --filters "Name=state,Values=available" \ | |
"Name=architecture,Values=x86_64" \ | |
"Name=root-device-type,Values=ebs" \ | |
"Name=virtualization-type,Values=hvm" \ | |
"Name=block-device-mapping.volume-type,Values=gp2" \ | |
"Name=hypervisor,Values=xen" \ | |
--query 'Images[?Description!=null]|[?contains(Description,`Amazon Linux`) == `true`]|\ | |
[?contains(Description,` NAT `)==`false`]|[?contains(Description,` ECS `)==`false`]|\ | |
sort_by(@, &CreationDate)[-1]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment