0

I have an ELB with two instances attached to it all the time and running. I have a third EC2 instance which is in the stopped state. I DO NOT WANT TO USE Autoscaling. Whenever load increases more than a threshold on those two running servers, the third instance should start and attach itself to ELB. When load decreases, it should remove itself from ELB and stop.

Any idea ?

Yeleshwar
  • 81
  • 3
  • I'm interested to hear why you don't want to use auto scaling, it's ideal for this kind of scenario. I guess you could set up a CloudWatch alert that triggers a lambda function that starts the third server, or something like that. – Tim Jan 11 '17 at 22:37
  • Thanks Tim! I was thinking if there could be a way to achieve it via script or something. Lambda and Autoscaling are not my options. – Yeleshwar Jan 12 '17 at 15:48
  • Perhaps you should post all your limitations on the question so we can understand them. You can either post a list of AWS services you can use, or the ones you can't. You might also like to explain why you can't use those services. – Tim Jan 12 '17 at 17:28

1 Answers1

0

Currently you can not do this using just Amazon provided services. What I would recommend is:

  1. Attach a CloudWatch Alarm to your EC2 instances metrics. When the alarm is triggered, publish to a SNSTopic
  2. Attach an AWS Lambda function to the SNSTopic, provide the Role with enough permissions to
    1. Start the EC2 instance
    2. Attach the ELB to the instances
  3. Add a second alarm, AWS Lambda function and do the same the other way around. Stop the EC2 instance and unattach it.
M. Glatki
  • 1,964
  • 1
  • 17
  • 33