Class: AWSCDK::ApplicationAutoScaling::ScalingSchedule

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
application_auto_scaling/scaling_schedule.rb

Overview

A scheduled scaling action.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schedule:, end_time: nil, max_capacity: nil, min_capacity: nil, start_time: nil, time_zone: nil) ⇒ ScalingSchedule

Returns a new instance of ScalingSchedule.

Parameters:

  • schedule (AWSCDK::ApplicationAutoScaling::Schedule)

    When to perform this action.

  • end_time (DateTime, nil) (defaults to: nil)

    When this scheduled action expires.

  • max_capacity (Numeric, nil) (defaults to: nil)

    The new maximum capacity.

  • min_capacity (Numeric, nil) (defaults to: nil)

    The new minimum capacity.

  • start_time (DateTime, nil) (defaults to: nil)

    When this scheduled action becomes active.

  • time_zone (AWSCDK::TimeZone, nil) (defaults to: nil)

    The time zone used when referring to the date and time of a scheduled action, when the scheduled action uses an at or cron expression.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'application_auto_scaling/scaling_schedule.rb', line 13

def initialize(schedule:, end_time: nil, max_capacity: nil, min_capacity: nil, start_time: nil, time_zone: nil)
  @schedule = schedule
  Jsii::Type.check_type(@schedule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5TY2hlZHVsZSJ9")), "schedule")
  @end_time = end_time
  Jsii::Type.check_type(@end_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJkYXRlIn0=")), "endTime") unless @end_time.nil?
  @max_capacity = max_capacity
  Jsii::Type.check_type(@max_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxCapacity") unless @max_capacity.nil?
  @min_capacity = min_capacity
  Jsii::Type.check_type(@min_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minCapacity") unless @min_capacity.nil?
  @start_time = start_time
  Jsii::Type.check_type(@start_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJkYXRlIn0=")), "startTime") unless @start_time.nil?
  @time_zone = time_zone
  Jsii::Type.check_type(@time_zone, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5UaW1lWm9uZSJ9")), "timeZone") unless @time_zone.nil?
end

Instance Attribute Details

#end_timeDateTime? (readonly)

Note:

Default: The rule never expires.

When this scheduled action expires.

Returns:

  • (DateTime, nil)


36
37
38
# File 'application_auto_scaling/scaling_schedule.rb', line 36

def end_time
  @end_time
end

#max_capacityNumeric? (readonly)

Note:

Default: No new maximum capacity

The new maximum capacity.

During the scheduled time, the current capacity is above the maximum capacity, Application Auto Scaling scales in to the maximum capacity.

At least one of maxCapacity and minCapacity must be supplied.

Returns:

  • (Numeric, nil)


46
47
48
# File 'application_auto_scaling/scaling_schedule.rb', line 46

def max_capacity
  @max_capacity
end

#min_capacityNumeric? (readonly)

Note:

Default: No new minimum capacity

The new minimum capacity.

During the scheduled time, if the current capacity is below the minimum capacity, Application Auto Scaling scales out to the minimum capacity.

At least one of maxCapacity and minCapacity must be supplied.

Returns:

  • (Numeric, nil)


56
57
58
# File 'application_auto_scaling/scaling_schedule.rb', line 56

def min_capacity
  @min_capacity
end

#scheduleAWSCDK::ApplicationAutoScaling::Schedule (readonly)

When to perform this action.



31
32
33
# File 'application_auto_scaling/scaling_schedule.rb', line 31

def schedule
  @schedule
end

#start_timeDateTime? (readonly)

Note:

Default: The rule is activate immediately

When this scheduled action becomes active.

Returns:

  • (DateTime, nil)


61
62
63
# File 'application_auto_scaling/scaling_schedule.rb', line 61

def start_time
  @start_time
end

#time_zoneAWSCDK::TimeZone? (readonly)

Note:

Default: - UTC

The time zone used when referring to the date and time of a scheduled action, when the scheduled action uses an at or cron expression.

Returns:



66
67
68
# File 'application_auto_scaling/scaling_schedule.rb', line 66

def time_zone
  @time_zone
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
# File 'application_auto_scaling/scaling_schedule.rb', line 68

def self.jsii_properties
  {
    :schedule => "schedule",
    :end_time => "endTime",
    :max_capacity => "maxCapacity",
    :min_capacity => "minCapacity",
    :start_time => "startTime",
    :time_zone => "timeZone",
  }
end

Instance Method Details

#to_jsiiObject



79
80
81
82
83
84
85
86
87
88
89
90
# File 'application_auto_scaling/scaling_schedule.rb', line 79

def to_jsii
  result = {}
  result.merge!({
    "schedule" => @schedule,
    "endTime" => @end_time,
    "maxCapacity" => @max_capacity,
    "minCapacity" => @min_capacity,
    "startTime" => @start_time,
    "timeZone" => @time_zone,
  })
  result.compact
end