Created
February 12, 2019 01:13
-
-
Save kilfu0701/4037671d6f9cfcd6007cf20af4c8fb9e to your computer and use it in GitHub Desktop.
get private IP address by aws instance id
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 --output json --region ap-northeast-1 --instance-ids i-YYYYYY | \ | |
python -c " | |
import sys; | |
import json; | |
print(json.loads(sys.stdin.read())['Reservations'][0]['Instances'][0]['PrivateIpAddress']) | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment