interface CronOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AutoScaling.CronOptions |
Java | software.amazon.awscdk.services.autoscaling.CronOptions |
Python | aws_cdk.aws_autoscaling.CronOptions |
TypeScript (source) | @aws-cdk/aws-autoscaling » CronOptions |
Options to configure a cron expression.
All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.
See also: http://crontab.org/
Example
import * as autoscaling from '@aws-cdk/aws-autoscaling';
declare const fn: lambda.Function;
const alias = fn.addAlias('prod');
// Create AutoScaling target
const as = alias.addAutoScaling({ maxCapacity: 50 });
// Configure Target Tracking
as.scaleOnUtilization({
utilizationTarget: 0.5,
});
// Configure Scheduled Scaling
as.scaleOnSchedule('ScaleUpInTheMorning', {
schedule: autoscaling.Schedule.cron({ hour: '8', minute: '0'}),
minCapacity: 20,
});
Properties
Name | Type | Description |
---|---|---|
day? | string | The day of the month to run this rule at. |
hour? | string | The hour to run this rule at. |
minute? | string | The minute to run this rule at. |
month? | string | The month to run this rule at. |
week | string | The day of the week to run this rule at. |
day?
Type:
string
(optional, default: Every day of the month)
The day of the month to run this rule at.
hour?
Type:
string
(optional, default: Every hour)
The hour to run this rule at.
minute?
Type:
string
(optional, default: Every minute)
The minute to run this rule at.
month?
Type:
string
(optional, default: Every month)
The month to run this rule at.
weekDay?
Type:
string
(optional, default: Any day of the week)
The day of the week to run this rule at.