Skip to content

Instantly share code, notes, and snippets.

@estahn
Last active December 24, 2015 23:29
Show Gist options
  • Save estahn/6880125 to your computer and use it in GitHub Desktop.
Save estahn/6880125 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
aws ec2 describe-instances \
--filters Name=dns-name,Values=ec2-12-345-678-90.myregion.compute.amazonaws.com \
| jq '.Reservations [] .Instances [] .InstanceId'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment