1

I created one ELB and attached a few instances to this ELB. So when I login into one of these instance, I would like to type a command or run a nodejs script that can return me the its ELB name, is it possible? I know I can look up on AWS console but I'm looking for a way to look it up programmatically. If possible, I would like to see how it is done in AWS Nodejs SDK

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Nam Nguyen
  • 5,668
  • 14
  • 56
  • 70
  • I read this doc: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html but did not see they mention anything about ELB – Nam Nguyen Apr 03 '14 at 01:43

2 Answers2

0

You do not run nodejs on an elb instance. elb is proxy to load balance client requests to your app server where you run nodejs.

yadab
  • 2,063
  • 1
  • 16
  • 24
0

You could use the aws command line tools (http://aws.amazon.com/cli/):

aws elb describe-load-balancers

Parse the JSON output for the instance ID (which you can get using this answer: Find out the instance id from within an ec2 machine) and look for whatever ELB it's attached too.

Community
  • 1
  • 1
jpancoast
  • 511
  • 3
  • 7