Blog

Geplante Skalierung für EC2 Auto Scaling

Tibor Hercz

Tibor Hercz

Aktualisiert Dezember 5, 2025
1 Minute

Geplante Skalierung für EC2 Auto Scaling kann bei vorhersehbarer Auslastung helfen, indem es Kapazitätsänderungen nach einem Zeitplan festlegt.
Zum Beispiel, wenn eine arbeitsreiche Periode erwartet wird oder um Geld für Ihre Entwicklungsumgebung zu sparen, indem Sie sie außerhalb der Bürozeiten herunterfahren. Geplante automatische Skalierung unterstützt einmalige Skalierungsereignisse oder auf einer wiederkehrenden Basis.
Um einen wiederkehrenden Skalierungszeitplan zu erstellen, können Sie einen cron-Ausdruck mit optionalem Start- und/oder Enddatum und -uhrzeit verwenden. Die Beispiele sind für Terraform und CloudFormation.
Beide tun Folgendes:

  • montags-freitags um 22:00 Uhr abnehmen
  • montags-freitags um 06:00 Uhr

Terraform

resource "aws_autoscaling_schedule" "development-up" {
  scheduled_action_name  = "development-up"
  min_size = 1
  max_size = 3
  desired_capacity = 2
  time_zone = "Europe/Amsterdam"
  recurrence = "00 06 * * 1-5"
  autoscaling_group_name = aws_autoscaling_group.example.name
}

resource "aws_autoscaling_schedule" "development-down" {
  scheduled_action_name  = "development-down"
  min_size = 0
  max_size = 0
  desired_capacity = 0
  time_zone = "Europe/Amsterdam"
  recurrence = "00 22 * * 1-5"
  autoscaling_group_name = aws_autoscaling_group.example.name
}

CloudFormation

Resources:
  ScheduledActionUp:
    Type: AWS::AutoScaling::ScheduledAction
    Properties:
      AutoScalingGroupName: !Ref autoScalingGroup
      MaxSize: '3'
      MinSize: '1'
      DesiredCapacity: '2'
      TimeZone: 'Europe/Amsterdam'
      Recurrence: 00 06 * * 1-5
  ScheduledActionDown:
    Type: AWS::AutoScaling::ScheduledAction
    Properties:
      AutoScalingGroupName: !Ref autoScalingGroup
      MaxSize: '0'
      MinSize: '0'
      DesiredCapacity: '0'
      TimeZone: 'Europe/Amsterdam'
      Recurrence: 00 22 * * 1-5

Quelle

AWS Geplante Skalierung für Amazon EC2 Auto Scaling

Verfasst von

Tibor Hercz

Tibor is a Cloud Consultant specialized in AWS with a strong background in Software engineering and has a passion for Compute, Networking and Security. His goal is to create simple Cloud Solutions that increases the efficiency and overall happiness of the teams and business. Sharing knowledge is important to him, so you will see him blogging and sharing knowledge about solutions he has built.

Contact

Let’s discuss how we can support your journey.