Schedule
- class aws_cdk.aws_autoscaling.Schedule
Bases:
object
Schedule for scheduled scaling actions.
- ExampleMetadata:
infused
Example:
# auto_scaling_group: autoscaling.AutoScalingGroup auto_scaling_group.scale_on_schedule("PrescaleInTheMorning", schedule=autoscaling.Schedule.cron(hour="8", minute="0"), min_capacity=20 ) auto_scaling_group.scale_on_schedule("AllowDownscalingAtNight", schedule=autoscaling.Schedule.cron(hour="20", minute="0"), min_capacity=1 )
Attributes
- expression_string
Retrieve the expression for this schedule.
Static Methods
- classmethod cron(*, day=None, hour=None, minute=None, month=None, week_day=None)
Create a schedule from a set of cron fields.
- Parameters:
day (
Optional
[str
]) – The day of the month to run this rule at. Default: - Every day of the monthhour (
Optional
[str
]) – The hour to run this rule at. Default: - Every hourminute (
Optional
[str
]) – The minute to run this rule at. Default: - Every minutemonth (
Optional
[str
]) – The month to run this rule at. Default: - Every monthweek_day (
Optional
[str
]) – The day of the week to run this rule at. Default: - Any day of the week
- Return type:
- classmethod expression(expression)
Construct a schedule from a literal schedule expression.
- Parameters:
expression (
str
) – The expression to use. Must be in a format that AutoScaling will recognize- See:
- Return type: