Last active
November 14, 2022 12:13
-
-
Save gdamjan/09bf59445a6ef3c4c99933c2c0374560 to your computer and use it in GitHub Desktop.
Get the AMI id of the latest official Debian/Fedora/Ubuntu images (hvm-x86_64-gp2) | awscli
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
# Debian 10 | |
aws ec2 describe-images \ | |
--region us-east-1 \ | |
--owners 136693071363 \ | |
--filters 'Name=name,Values=debian-10-amd64-*' \ | |
--query 'sort_by(Images, &CreationDate)[-1].[ImageId,Name,CreationDate]' \ | |
--output text | |
## | |
# additional filters: | |
# 'Name=name,Values=debian-stretch-*' | |
# 'Name=architecture,Values=x86_64' | |
# 'Name=virtualization-type,Values=hvm' | |
# | |
# Debian 9 (old owner) | |
aws ec2 describe-images \ | |
--region us-east-1 \ | |
--owners 379101102735 \ | |
--filters 'Name=name,Values=debian-stretch-hvm-x86_64-gp2-*' \ | |
--query 'sort_by(Images, &CreationDate)[-1].[ImageId,Name,CreationDate]' \ | |
--output text | |
# Ubuntu: | |
aws ec2 describe-images \ | |
--region us-east-1 \ | |
--owners 099720109477 \ | |
--filters 'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*' \ | |
--query 'sort_by(Images, &CreationDate)[-1].[ImageId,Name,CreationDate]' \ | |
--output text | |
# Fedora | |
aws ec2 describe-images \ | |
--region us-east-1 \ | |
--owners 125523088429 \ | |
--filters 'Name=name,Values=Fedora-Cloud-Base-30-*x86_64-hvm-*-gp2-*' \ | |
--query 'sort_by(Images, &CreationDate)[-1].[ImageId,Name,CreationDate]' \ | |
--output text | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for which accounts? those are public images.
for
aws ec2
api calls you do need basic aws credentials, true.