Last active
August 29, 2015 13:58
-
-
Save siroken3/9971180 to your computer and use it in GitHub Desktop.
指定したインスタンスidのうち、runningなステータスのものの privateipaddressを取得する
This file contains hidden or 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-instances --region ap-northeast-1 --instance-ids ${instance_ids} --filters '[{"Name":"instance-state-name", "Values":["running"]}]' | jq -r '.Reservations[].Instances[].PrivateIpAddress' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
instance_id は複数
i-xxxx i-yyyy i-zzzzz
のように空白で区切って複数指定可能