BasicScheduledActionProps

class aws_cdk.aws_autoscaling.BasicScheduledActionProps(*, schedule, desired_capacity=None, end_time=None, max_capacity=None, min_capacity=None, start_time=None, time_zone=None)

Bases: object

Properties for a scheduled scaling action.

Parameters
  • schedule (Schedule) – When to perform this action. Supports cron expressions. For more information about cron expressions, see https://en.wikipedia.org/wiki/Cron.

  • desired_capacity (Union[int, float, None]) – The new desired capacity. At the scheduled time, set the desired capacity to the given capacity. At least one of maxCapacity, minCapacity, or desiredCapacity must be supplied. Default: - No new desired capacity.

  • end_time (Optional[datetime]) – When this scheduled action expires. Default: - The rule never expires.

  • max_capacity (Union[int, float, None]) – The new maximum capacity. At the scheduled time, set the maximum capacity to the given capacity. At least one of maxCapacity, minCapacity, or desiredCapacity must be supplied. Default: - No new maximum capacity.

  • min_capacity (Union[int, float, None]) – The new minimum capacity. At the scheduled time, set the minimum capacity to the given capacity. At least one of maxCapacity, minCapacity, or desiredCapacity must be supplied. Default: - No new minimum capacity.

  • start_time (Optional[datetime]) – When this scheduled action becomes active. Default: - The rule is activate immediately.

  • time_zone (Optional[str]) – Specifies the time zone for a cron expression. If a time zone is not provided, UTC is used by default. Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as Etc/GMT+9 or Pacific/Tahiti). For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. Default: - UTC

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

desired_capacity

The new desired capacity.

At the scheduled time, set the desired capacity to the given capacity.

At least one of maxCapacity, minCapacity, or desiredCapacity must be supplied.

Default
  • No new desired capacity.

Return type

Union[int, float, None]

end_time

When this scheduled action expires.

Default
  • The rule never expires.

Return type

Optional[datetime]

max_capacity

The new maximum capacity.

At the scheduled time, set the maximum capacity to the given capacity.

At least one of maxCapacity, minCapacity, or desiredCapacity must be supplied.

Default
  • No new maximum capacity.

Return type

Union[int, float, None]

min_capacity

The new minimum capacity.

At the scheduled time, set the minimum capacity to the given capacity.

At least one of maxCapacity, minCapacity, or desiredCapacity must be supplied.

Default
  • No new minimum capacity.

Return type

Union[int, float, None]

schedule

When to perform this action.

Supports cron expressions.

For more information about cron expressions, see https://en.wikipedia.org/wiki/Cron.

Return type

Schedule

start_time

When this scheduled action becomes active.

Default
  • The rule is activate immediately.

Return type

Optional[datetime]

time_zone

Specifies the time zone for a cron expression.

If a time zone is not provided, UTC is used by default.

Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as Etc/GMT+9 or Pacific/Tahiti).

For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

Default
  • UTC

Return type

Optional[str]