Interface ScalingSchedule
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
ScalingSchedule.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:30.912Z")
@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())
.minHealthyPercent(100)
.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());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forScalingSchedulestatic final classAn implementation forScalingSchedule -
Method Summary
Modifier and TypeMethodDescriptionstatic ScalingSchedule.Builderbuilder()default InstantWhen this scheduled action expires.default NumberThe new maximum capacity.default NumberThe new minimum capacity.When to perform this action.default InstantWhen this scheduled action becomes active.default TimeZoneThe time zone used when referring to the date and time of a scheduled action, when the scheduled action uses an at or cron expression.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getSchedule
When to perform this action. -
getEndTime
When this scheduled action expires.Default: The rule never expires.
-
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
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
When this scheduled action becomes active.Default: The rule is activate immediately
-
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
- Returns:
- a
ScalingSchedule.BuilderofScalingSchedule
-