Skip to content

Instantly share code, notes, and snippets.

aws ec2 describe-images \
--region ap-northeast-1 \
--owners amazon \
--filters "Name=name,Values=amzn-ami-hvm-*-gp2" \
--query 'reverse(sort_by(Images,&CreationDate))[0].ImageId' \
--output text