Interface ScalingSchedule

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ScalingSchedule.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-27T16:50:52.786Z") @Stability(Stable) public interface ScalingSchedule extends software.amazon.jsii.JsiiSerializable
A scheduled scaling action.

Example:

 Cluster cluster;
 ApplicationLoadBalancedFargateService loadBalancedFargateService = ApplicationLoadBalancedFargateService.Builder.create(this, "Service")
         .cluster(cluster)
         .memoryLimitMiB(1024)
         .desiredCount(1)
         .cpu(512)
         .taskImageOptions(ApplicationLoadBalancedTaskImageOptions.builder()
                 .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                 .build())
         .build();
 ScalableTaskCount scalableTarget = loadBalancedFargateService.service.autoScaleTaskCount(EnableScalingProps.builder()
         .minCapacity(5)
         .maxCapacity(20)
         .build());
 scalableTarget.scaleOnSchedule("DaytimeScaleDown", ScalingSchedule.builder()
         .schedule(Schedule.cron(CronOptions.builder().hour("8").minute("0").build()))
         .minCapacity(1)
         .build());
 scalableTarget.scaleOnSchedule("EveningRushScaleUp", ScalingSchedule.builder()
         .schedule(Schedule.cron(CronOptions.builder().hour("20").minute("0").build()))
         .minCapacity(10)
         .build());
 
  • Method Details

    • getSchedule

      @Stability(Stable) @NotNull Schedule getSchedule()
      When to perform this action.
    • getEndTime

      @Stability(Stable) @Nullable default Instant getEndTime()
      When this scheduled action expires.

      Default: The rule never expires.

    • getMaxCapacity

      @Stability(Stable) @Nullable default Number getMaxCapacity()
      The new maximum capacity.

      During the scheduled time, the current capacity is above the maximum capacity, Application Auto Scaling scales in to the maximum capacity.

      At least one of maxCapacity and minCapacity must be supplied.

      Default: No new maximum capacity

    • getMinCapacity

      @Stability(Stable) @Nullable default Number getMinCapacity()
      The new minimum capacity.

      During the scheduled time, if the current capacity is below the minimum capacity, Application Auto Scaling scales out to the minimum capacity.

      At least one of maxCapacity and minCapacity must be supplied.

      Default: No new minimum capacity

    • getStartTime

      @Stability(Stable) @Nullable default Instant getStartTime()
      When this scheduled action becomes active.

      Default: The rule is activate immediately

    • getTimeZone

      @Stability(Stable) @Nullable default TimeZone getTimeZone()
      The time zone used when referring to the date and time of a scheduled action, when the scheduled action uses an at or cron expression.

      Default: - UTC

    • builder

      @Stability(Stable) static ScalingSchedule.Builder builder()
      Returns:
      a ScalingSchedule.Builder of ScalingSchedule