symbol-bootstrap
symbol-bootstrap copied to clipboard
Auto resolve IP/Hostname from AWS EC2 Instance
This feature is to allow users to set up the custom preset with a tag that tells bootstrap to resolve the public IP or hostname of an ec2 node automatically.
Something like:
nodes:
- host: {{ec2PublicIP}}
nodes:
- host: {{ec2PublicHostanme}}
By calling the current ec2 instance meta-data:
curl http://169.254.169.254/latest/meta-data/public-ipv4 curl http://169.254.169.254/latest/meta-data/public-hostname
There are some nuances. The instance should have metadata v1 enabled. With metadata v2, it is more secure. SO, you'll need to get a token first.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html#instancedata-meta-data-retrieval-examples
We could add similar helper functions for other cloud providers.