Skip to content

Instantly share code, notes, and snippets.

@takenoco82
Last active August 5, 2019 13:33
Show Gist options
  • Save takenoco82/b783ed7c17d640d9707cb1ca93998281 to your computer and use it in GitHub Desktop.
Save takenoco82/b783ed7c17d640d9707cb1ca93998281 to your computer and use it in GitHub Desktop.

AWS CLI でよく使うコマンド

aws ec2 describe-instances

  • EC2インスタンスの一覧を取得する。query編
$ aws ec2 describe-instances --query "$(echo 'Reservations[].Instances[].{
  InstanceId:InstanceId,
  ImageId:ImageId,
  InstanceType:InstanceType,
  PrivateIpAddress:PrivateIpAddress,
  PublicIpAddress:PublicIpAddress,
  State:State.Name,
  Name:Tags[?Key==`Name`].Value|[0]
}')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment