Skip to content

Instantly share code, notes, and snippets.

@richarvey
Last active August 14, 2017 10:56
Show Gist options
  • Save richarvey/893048f50648ccf475061b9015fa80e2 to your computer and use it in GitHub Desktop.
Save richarvey/893048f50648ccf475061b9015fa80e2 to your computer and use it in GitHub Desktop.
CoreOS_latest_AMI fuction
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
}
@richarvey
Copy link
Author

This will return the latest stable ami ID for coreOS in a given region. Just add it to your .bash_profile/rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment