Skip to content

Instantly share code, notes, and snippets.

@kongou-ae
Created April 19, 2017 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kongou-ae/36c396f6fcf43b58e55ddcd69eb8fc76 to your computer and use it in GitHub Desktop.
Save kongou-ae/36c396f6fcf43b58e55ddcd69eb8fc76 to your computer and use it in GitHub Desktop.
get ami-id of latest windows server by AMI
aws ec2 describe-images --owner self amazon --profile lambda --region ap-northeast-1 --filters 'Name=platform,Values=windows,Name=name,Values=Windows_Server-2012-R2*Japanese-64Bit-Base*' --query 'reverse(sort_by(Images,&CreationDate))[0].ImageId' --output text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment