Created
August 15, 2017 04:30
-
-
Save shiumachi/d2312285539968521bb154bcbb7f0568 to your computer and use it in GitHub Desktop.
AWS上の特定のインスタンスのホスト名とIPアドレスを取得する
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
PROFILE=your_profile | |
INSTANCE_NAME=your_instance_name | |
aws --profile ${PROFILE} ec2 describe-instances | jq -r ".Reservations[] | select(.Instances[0].Tags[].Value == \"${INSTANCE_NAME}\") | .Instances[0] | {PrivateDnsName: .PrivateDnsName, PrivateIpAddress: .PrivateIpAddress, PublicDnsName: .PublicDnsName, PublicIpAddress: .PublicIpAddress}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment