Last active
August 14, 2017 10:56
-
-
Save richarvey/893048f50648ccf475061b9015fa80e2 to your computer and use it in GitHub Desktop.
CoreOS_latest_AMI fuction
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
coreos() { | |
if [ "$1" == "" ]; then | |
echo "please specify a regions (eg: eu-west-1)" | |
else | |
aws ec2 describe-images --region=$1 --owner=595879546273 --filters "Name=virtualization-type,Values=hvm" "Name=name,Values=CoreOS-stable*" --query 'sort_by(Images,&CreationDate)[- 1].{id:ImageId}' | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will return the latest stable ami ID for coreOS in a given region. Just add it to your .bash_profile/rc