-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch public IP without aws-lib. #11
Conversation
AWS provides metadata about each EC2 instance at http://169.254.169.254/latest/meta-data. By making use of this metadata, lynckia no longer requires AWS credentials.
Amazon documentation for the feature: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html |
Thank you for this contribution. The idea of getting the public IP without using AWS credentials sounds very interesting for the code. The only problem I see here is that it would be better to make the HTTP request from Erizo Controller and not from Cloud Handler, because they could be hosted on different machines and you want to know the IP from Erizo Controller. A possible solution would be to send that request from Erizo Controller and send the public IP address instead of the private one. There you have to check if Erizo Controller runs in Amazon. Byron, could you change your commit following this ideas? |
As Nuve and ErizoController may run on different hosts, detect the amazon public ip on the erizo controller. Note that on amazon hosts we still have to detect the private IP so that it can be properly replaced in other messages.
Updated the branch according to suggestion from jcague. |
Thank you Byron. We wil test your code and accept the request during the next week. Thanks for the post on your blog also! That's a very good graph that will help future developers to better understand Licode. |
No offense but I think this is all overkill. Anyone using amazon already knows how to get their public ip. If I have to edit the licode_config.js to just add "amazon" then I might as well just add the public ip and port to the licode_config.js. Adding the ip address and port to the licode_config.js gets rid of the necessity for the whole amazon section in the licode_config.js and fixes the ec.ip + ':8080' issue in tokenResources as well. Just use the ip+port from the licode_config.js. If you really, really, want to do this in some automated fashion move it to the install scripts and then update the licode_config.js from there. For example, if you curl the metadata link with a small --connect-timeout 5 and if it fails you are not on an amazon instance. If it returns data then update the licode_config.js with the ip address and default port of 8080. This way those of us who deploy this directly to amazon for the first time don't have to go find the google group posts that tell us how to set it up in Amazon. It will work right out of the box through the proper install scripts. Once we are used to licode and start configuring it for how we need it to run we can just set the proper values in the licode_config.js without having to update the actual javascript code to remove the port. |
This pull request is out of date and #76 should be used instead. |
AWS provides metadata about each EC2 instance at
http://169.254.169.254/latest/meta-data. By making use of this metadata,
lynckia no longer requires AWS credentials.