Skip to content
v2.274.0

ScheduledActionProps Struct ​

Properties for a scheduled action on an AutoScalingGroup.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
import { aws_autoscaling as interfaces_autoscaling } from 'aws-cdk-lib/interfaces';

declare const autoScalingGroupRef: interfaces_autoscaling.IAutoScalingGroupRef;
declare const schedule: autoscaling.Schedule;
const scheduledActionProps: autoscaling.ScheduledActionProps = {
  autoScalingGroup: autoScalingGroupRef,
  schedule: schedule,

  // the properties below are optional
  desiredCapacity: 123,
  endTime: new Date(),
  maxCapacity: 123,
  minCapacity: 123,
  startTime: new Date(),
  timeZone: 'timeZone',
};

Properties ​

autoScalingGroupIAutoScalingGroupRefauto_scaling_groupIAutoScalingGroupRefautoScalingGroupIAutoScalingGroupRefAutoScalingGroupIAutoScalingGroupRefAutoScalingGroupIAutoScalingGroupRefrequired#
The AutoScalingGroup to apply the scheduled actions to.
desiredCapacityoptionalnumberdesired_capacityoptionalint | floatdesiredCapacityoptionalNumberDesiredCapacityoptionaldoubleDesiredCapacityoptional*float64#
The new desired capacity.

Default: No 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.

endTimeoptionaldateend_timeoptionaldatetimeendTimeoptionalInstantEndTimeoptionalDateTimeEndTimeoptional*time.Time#
When this scheduled action expires.

Default: The rule never expires.

notes

Warning! You should not set this field! After the scheduled end time, the AutoScaling service will delete the ScheduledAction without CloudFormation's knowledge, and subsequent stack deployments that try to modify or delete this ScheduledAction will fail.

maxCapacityoptionalnumbermax_capacityoptionalint | floatmaxCapacityoptionalNumberMaxCapacityoptionaldoubleMaxCapacityoptional*float64#
The new maximum capacity.

Default: No 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.

minCapacityoptionalnumbermin_capacityoptionalint | floatminCapacityoptionalNumberMinCapacityoptionaldoubleMinCapacityoptional*float64#
The new minimum capacity.

Default: No 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.

scheduleSchedulescheduleSchedulescheduleScheduleScheduleScheduleScheduleSchedulerequired#
When to perform this action.

Supports cron expressions.

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

startTimeoptionaldatestart_timeoptionaldatetimestartTimeoptionalInstantStartTimeoptionalDateTimeStartTimeoptional*time.Time#
When this scheduled action becomes active.

Default: The rule is activate immediately.

timeZoneoptionalstringtime_zoneoptionalstrtimeZoneoptionalStringTimeZoneoptionalstringTimeZoneoptional*string= UTC#
Specifies the time zone for a cron expression.
notes

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.