Home > OS >  AWS CDK autoscalingGroup schedule automatically adapts to summer and winter times?
AWS CDK autoscalingGroup schedule automatically adapts to summer and winter times?

Time:07-06

When adding a schedule to an autoscaling group via CDK, I can select the timezone:

declare autoscalingGroup: IAutoscalingGroup;

autoscalingGroup.scaleOnSchedule(
  "LogicalId",
  {
    minCapacity: 150,
    maxCapacity: 150,
    schedule: Schedule.expression("0 18 * * *"),
    timeZone: "Europe/Berlin"
  }
 );

What does the code above mean? Will I automatically scale down to 150 instances at 16.00 UTC during summer, but at 17.00 UTC during winter?


CDK reference: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.BasicScheduledActionProps.html

Cloudformation reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-as-scheduledaction.html#cfn-as-scheduledaction-timezone

CodePudding user response:

Yes -- it means exactly that. UTC is constant and is unaffected by daylight savings unlike CEST.

So because you've used a CEST timezone, your scaling will happen at different UTC times in summer and winter as you've correctly stated.

By default, the recurring schedules that you set are in Coordinated Universal Time (UTC). You can change the time zone to correspond to your local time zone or a time zone for another part of your network. When you specify a time zone that observes Daylight Saving Time (DST), the action automatically adjusts for DST. -- Reference

  • Related