Last active
March 27, 2017 22:19
-
-
Save nikolay/12f4ca2a592bbfa0df57c3bbccb92f0f to your computer and use it in GitHub Desktop.
Get the latest Amazon Linux AMI ID
This file contains hidden or 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
aws ec2 describe-images \ | |
--owners amazon \ | |
--filters \ | |
'Name=name,Values=amzn-ami-hvm-????.??.?.????????-x86_64-gp2' \ | |
'Name=state,Values=available' \ | |
'Name=architecture,Values=x86_64' \ | |
'Name=virtualization-type,Values=hvm' \ | |
'Name=root-device-type,Values=ebs' \ | |
--query 'sort_by(Images, &CreationDate)[-1].ImageId' |
This file contains hidden or 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
aws ec2 describe-images \ | |
--owners amazon \ | |
--filters \ | |
'Name=name,Values=amzn-ami-????.??.g-amazon-ecs-optimized' \ | |
'Name=state,Values=available' \ | |
'Name=architecture,Values=x86_64' \ | |
'Name=virtualization-type,Values=hvm' \ | |
'Name=root-device-type,Values=ebs' \ | |
--query 'sort_by(Images, &CreationDate)[-1].ImageId' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment