Skip to content

Instantly share code, notes, and snippets.

@siroken3
Last active August 29, 2015 13:58
Show Gist options
  • Select an option

  • Save siroken3/9971180 to your computer and use it in GitHub Desktop.

Select an option

Save siroken3/9971180 to your computer and use it in GitHub Desktop.
指定したインスタンスidのうち、runningなステータスのものの privateipaddressを取得する
aws ec2 describe-instances --region ap-northeast-1 --instance-ids ${instance_ids} --filters '[{"Name":"instance-state-name", "Values":["running"]}]' | jq -r '.Reservations[].Instances[].PrivateIpAddress'
@siroken3
Copy link
Author

siroken3 commented Apr 4, 2014

instance_id は複数

i-xxxx i-yyyy i-zzzzz

のように空白で区切って複数指定可能

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