Reputation: 43
I want to start and stop nodes on Amazon EC2 instance on certain time. How can I do it?
Upvotes: 0
Views: 367
Reputation: 12891
You have multiple options for it:
You can use some simple lambda functions that can describe your EC2 instances and start or stop instances, and then use them on a schedule: http://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-events.html
You can use auto scaling to add or remove instances in an auto scaling group, including moving from 0 to 1 and from 1 to 0. This can also be scheduled: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html
You can also using CloudWatch alarms to control your EC2 instances. You can do that on various metrics, such as being idle at night, if you want to make sure that your EC2 instances are not wasted when not needed: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/UsingAlarmActions.html
And you can combine the various options together, when some are stoping your instances and some are starting them back.
Upvotes: 1