Last active
December 24, 2015 23:29
-
-
Save estahn/6880172 to your computer and use it in GitHub Desktop.
Identify Amazon EC2 instance id by hostname - http://blog.enricostahn.com/identify-amazon-ec2-instance-id-by-hostname
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 \ | |
| --filters Name=dns-name,Values=ec2-12-345-678-90.myregion.compute.amazonaws.com \ | |
| | jq '.Reservations [] .Instances [] .InstanceId' \ | |
| | xargs -n1 aws ec2 get-console-output --instance-id \ | |
| | jq '.Output' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment