Skip to content

Instantly share code, notes, and snippets.

@systemonkey
systemonkey / toggleAutoScalingGroup.md
Created September 26, 2021 19:41 — forked from veuncent/toggleAutoScalingGroup.md
AWS Auto Scaling Groups: scheduled start/stop

Tutorial: scheduled start/stop of EC2 instances managed by Auto Scaling Groups

If your EC2 instances in AWS are managed through Auto Scaling Groups, it is easy to schedule startup and shutdown of those instances, e.g. to save money.

This tutorial walks you through setting up an AWS Lambda function that is triggered by CloudWatch Events and automatically changes the min, max and desired instances in your Auto Scaling Group(s).

The idea is to toggle between 0 (stop) and a specifed min, max and desired amount of instances (start), so you only need a single Lambda function. The premise is that you do not touch these Auto Scaling Group settings manually, or you might make your EC2 instances nocturnal.

Create new Lambda function and Start Event

moved into my main check_mk plugin repo...