Ashis
Ashis

Reputation: 41

Schedule based start/stop of EC2 Instances in Autoscaling groups

Our requirement is we have Tibco BW components on top of AMAZON Ec2 instances and we need to start and stop instances on the timings provided by Business.Please note all EC2 instances are within the Autoscaling groups.

I was able to start and stop the EC2 instances when there is no autoscaling group involved.I had built a Lambda function and was triggering that function from Cloudwatch which was working fine.Nut I am not sure how to extend that to Ec2 instances which are having Autoscaling groups.

The expected result is that Applications on EC2 instances will be stopped depending on Schedule provided by Business.All the EC2 instances are within the Autoscaling group

Upvotes: 0

Views: 732

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269520

You can use Scheduled Scaling to modify an Auto Scaling group so that it adds/removes instances.

You can configure it to change one of three variables:

  • The Minimum number of instances. For example, increasing the minimum might launch additional instances.
  • The Maximum number of instances, which might cause instances to be terminated.
  • The Desired number of instances, which will set the quantity 'now', but the quantity might change later based upon other rules you have in place (eg when things get busy).

It is quite common for companies to increase the minimum quantity at the start of the day to provide more instances before things get busy. Similarly, it is common to decrease the minimum number of instances at night or on weekends to allow instances to scale-in if there are scaling rules in place to detect idle capacity.

Please note that Auto Scaling will either Launch new instances or Terminate existing instances. It does not start or stop instances.

See: Scheduled Scaling for Amazon EC2 Auto Scaling

Upvotes: 2

Related Questions