Last active
January 15, 2019 14:34
-
-
Save lmayorga1980/d1027e130de98b4faa32df0cfde8653b to your computer and use it in GitHub Desktop.
Queries to find specific AMIS based on the name
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
aws ec2 describe-images --owners amazon --filters 'Name=name,Values=Windows_Server-2016-English-Full-Base-????.??.??' 'Name=state,Values=available' | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId ' | |
aws ec2 describe-images --owners amazon --filters 'Name=name,Values=Windows_Server-2012-R2_RTM-English-P3-????.??.??' 'Name=state,Values=available' | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId ' | |
aws ec2 describe-images --owners amazon --filters 'Name=name,Values=Windows_Server-2016-English-Core-Base-????.??.??' 'Name=state,Values=available' | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId ' | |
aws ec2 describe-images --owners amazon --filters 'Name=name,Values=Windows_Server-2019-English-Core-Base-????.??.??' 'Name=state,Values=available' | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId ' | |
aws ec2 describe-images --owners amazon --filters 'Name=name,Values=Windows_Server-2019-English-Full-Base-????.??.??' 'Name=state,Values=available' | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment