Last active
August 29, 2015 14:23
-
-
Save sportebois/6b1daafa709e7aad69c3 to your computer and use it in GitHub Desktop.
Retrieve EC2 instance ID from the command line
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
curl http://169.254.169.254/latest/meta-data/instance-id |
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
#!/bin/bash | |
# Set the Amazon Instance ID as hostname | |
curl http://169.254.169.254/latest/meta-data/instance-id > /etc/hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment