Interface IScalingSchedule
A scheduled scaling action.
Namespace: Amazon.CDK.AWS.ApplicationAutoScaling
Assembly: Amazon.CDK.AWS.ApplicationAutoScaling.dll
Syntax (csharp)
public interface IScalingSchedule
Syntax (vb)
Public Interface 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
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. |
Properties
EndTime
When this scheduled action expires.
virtual Nullable<DateTime> EndTime { get; }
Property Value
System.Nullable<System.DateTime>
Remarks
Default: The rule never expires.
MaxCapacity
The new maximum capacity.
virtual Nullable<double> MaxCapacity { get; }
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.
virtual Nullable<double> MinCapacity { get; }
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.
virtual Nullable<DateTime> StartTime { get; }
Property Value
System.Nullable<System.DateTime>
Remarks
Default: The rule is activate immediately