Class: AWSCDK::Autoscaling::BasicScheduledActionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
autoscaling/basic_scheduled_action_props.rb

Overview

Properties for a scheduled scaling action.

Direct Known Subclasses

ScheduledActionProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of BasicScheduledActionProps.

Parameters:

  • schedule (AWSCDK::Autoscaling::Schedule)

    When to perform this action.

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

    The new desired capacity.

  • 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 (String, nil) (defaults to: nil)

    Specifies the time zone for a cron expression.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'autoscaling/basic_scheduled_action_props.rb', line 14

def initialize(schedule:, desired_capacity: nil, 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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuU2NoZWR1bGUifQ==")), "schedule")
  @desired_capacity = desired_capacity
  Jsii::Type.check_type(@desired_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "desiredCapacity") unless @desired_capacity.nil?
  @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("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "timeZone") unless @time_zone.nil?
end

Instance Attribute Details

#desired_capacityNumeric? (readonly)

Note:

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

Returns:

  • (Numeric, nil)


47
48
49
# File 'autoscaling/basic_scheduled_action_props.rb', line 47

def desired_capacity
  @desired_capacity
end

#end_timeDateTime? (readonly)

Note:

Default: - The rule never expires.

When this scheduled action expires.

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.

Returns:

  • (DateTime, nil)


56
57
58
# File 'autoscaling/basic_scheduled_action_props.rb', line 56

def end_time
  @end_time
end

#max_capacityNumeric? (readonly)

Note:

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

Returns:

  • (Numeric, nil)


65
66
67
# File 'autoscaling/basic_scheduled_action_props.rb', line 65

def max_capacity
  @max_capacity
end

#min_capacityNumeric? (readonly)

Note:

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

Returns:

  • (Numeric, nil)


74
75
76
# File 'autoscaling/basic_scheduled_action_props.rb', line 74

def min_capacity
  @min_capacity
end

#scheduleAWSCDK::Autoscaling::Schedule (readonly)

When to perform this action.

Supports cron expressions.

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



38
39
40
# File 'autoscaling/basic_scheduled_action_props.rb', line 38

def schedule
  @schedule
end

#start_timeDateTime? (readonly)

Note:

Default: - The rule is activate immediately.

When this scheduled action becomes active.

Returns:

  • (DateTime, nil)


79
80
81
# File 'autoscaling/basic_scheduled_action_props.rb', line 79

def start_time
  @start_time
end

#time_zoneString? (readonly)

Note:

Default: - UTC

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.

Returns:

  • (String, nil)


90
91
92
# File 'autoscaling/basic_scheduled_action_props.rb', line 90

def time_zone
  @time_zone
end

Class Method Details

.jsii_propertiesObject



92
93
94
95
96
97
98
99
100
101
102
# File 'autoscaling/basic_scheduled_action_props.rb', line 92

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

Instance Method Details

#to_jsiiObject



104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'autoscaling/basic_scheduled_action_props.rb', line 104

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