Class ScalingSchedule
A scheduled scaling action.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ApplicationAutoScaling
Assembly: Amazon.CDK.AWS.ApplicationAutoScaling.dll
Syntax (csharp)
public class ScalingSchedule : Object, IScalingSchedule
Syntax (vb)
Public Class ScalingSchedule
Inherits Object
Implements IScalingSchedule
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
var loadBalancedFargateService = new ApplicationLoadBalancedFargateService(this, "Service", new ApplicationLoadBalancedFargateServiceProps {
Cluster = cluster,
MemoryLimitMiB = 1024,
DesiredCount = 1,
Cpu = 512,
TaskImageOptions = new ApplicationLoadBalancedTaskImageOptions {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
}
});
var scalableTarget = loadBalancedFargateService.Service.AutoScaleTaskCount(new EnableScalingProps {
MinCapacity = 5,
MaxCapacity = 20
});
scalableTarget.ScaleOnSchedule("DaytimeScaleDown", new ScalingSchedule {
Schedule = Schedule.Cron(new CronOptions { Hour = "8", Minute = "0" }),
MinCapacity = 1
});
scalableTarget.ScaleOnSchedule("EveningRushScaleUp", new ScalingSchedule {
Schedule = Schedule.Cron(new CronOptions { Hour = "20", Minute = "0" }),
MinCapacity = 10
});
Synopsis
Constructors
ScalingSchedule() |
Properties
EndTime | When this scheduled action expires. |
MaxCapacity | The new maximum capacity. |
MinCapacity | The new minimum capacity. |
Schedule | When to perform this action. |
StartTime | When this scheduled action becomes active. |
Constructors
ScalingSchedule()
public ScalingSchedule()
Properties
EndTime
When this scheduled action expires.
public Nullable<DateTime> EndTime { get; set; }
Property Value
System.Nullable<System.DateTime>
Remarks
Default: The rule never expires.
MaxCapacity
The new maximum capacity.
public Nullable<double> MaxCapacity { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
MinCapacity
The new minimum capacity.
public Nullable<double> MinCapacity { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
Schedule
StartTime
When this scheduled action becomes active.
public Nullable<DateTime> StartTime { get; set; }
Property Value
System.Nullable<System.DateTime>
Remarks
Default: The rule is activate immediately