Class CronOptions
- Namespace
- Amazon.CDK.AWS.AutoScaling
- Assembly
- Amazon.CDK.AWS.AutoScaling.dll
Options to configure a cron expression.
public class CronOptions : ICronOptions
- Inheritance
-
CronOptions
- Implements
- Inherited Members
Examples
using Amazon.CDK.AWS.AutoScaling;
Function fn;
var alias = fn.AddAlias("prod");
// Create AutoScaling target
var as = alias.AddAutoScaling(new AutoScalingOptions { MaxCapacity = 50 });
// Configure Target Tracking
as.ScaleOnUtilization(new UtilizationScalingOptions {
UtilizationTarget = 0.5
});
// Configure Scheduled Scaling
as.ScaleOnSchedule("ScaleUpInTheMorning", new ScalingSchedule {
Schedule = Schedule.Cron(new CronOptions { Hour = "8", Minute = "0" }),
MinCapacity = 20
});
Remarks
All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.
See: http://crontab.org/
ExampleMetadata: infused
Constructors
CronOptions()
public CronOptions()
Properties
Day
The day of the month to run this rule at.
public string? Day { get; set; }
Property Value
Remarks
Default: - Every day of the month
Hour
The hour to run this rule at.
public string? Hour { get; set; }
Property Value
Remarks
Default: - Every hour
Minute
The minute to run this rule at.
public string? Minute { get; set; }
Property Value
Remarks
Default: - Every minute
Month
The month to run this rule at.
public string? Month { get; set; }
Property Value
Remarks
Default: - Every month
WeekDay
The day of the week to run this rule at.
public string? WeekDay { get; set; }
Property Value
Remarks
Default: - Any day of the week