Created
August 14, 2013 00:01
-
-
Save SavvyGuard/6226866 to your computer and use it in GitHub Desktop.
get the current EC2 instance's public host name. Easily changed to get private hostname and other info.
This file contains 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
import boto.utils | |
print boto.utils.get_instance_metadata()['network']['interfaces']['macs'].values()[0]['public-hostname'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment