AWS CDK AutoscalingGroup计划会自动适应夏季和冬季?

发布于 2025-02-13 11:12:39 字数 1026 浏览 2 评论 0原文

当通过CDK添加时间表时,我可以选择 timezone

declare autoscalingGroup: IAutoscalingGroup;

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

上面的代码 Mean nee 是什么?在夏季,我会在16.00 UTC时自动降低150个实例,但在冬季为17.00 UTC?


CDK参考: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.basicscheduledactionprops.html

href =“ https://docs.aws.amazon.com/awscloudformation/latest/userguide/aws-resource-asource-as-scheduledaction.html#cfn-as as-as-as-Scheduledaction timezone” rel =“ nofollow noreferrer“> https://docs.aws.amazon.com/awscloudformation/latest/userguide/aws-resource-as-as-scheduledaction.html#cfn-as-as-as-scheduledactionalaction time timezone

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一曲琵琶半遮面シ 2025-02-20 11:12:40

是的 - 完全是指。 UTC是恒定的,与CEST不同,日光储蓄不受影响。

因此,由于您使用了CEST时区,因此您的缩放时间将在您正确说明的夏季和冬季发生在不同的UTC时代。

默认情况下,您设置的重复计划是在协调的
通用时间(UTC)。您可以更改时区以对应
您的本地时区或网络另一部分的时区。
当您指定观察日光节省时间(DST)的时区时,
动作自动调整DST。 -

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文