Class: AWSCDK::Autoscaling::BasicScheduledActionProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Autoscaling::BasicScheduledActionProps
- Defined in:
- autoscaling/basic_scheduled_action_props.rb
Overview
Properties for a scheduled scaling action.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#desired_capacity ⇒ Numeric?
readonly
The new desired capacity.
-
#end_time ⇒ DateTime?
readonly
When this scheduled action expires.
-
#max_capacity ⇒ Numeric?
readonly
The new maximum capacity.
-
#min_capacity ⇒ Numeric?
readonly
The new minimum capacity.
-
#schedule ⇒ AWSCDK::Autoscaling::Schedule
readonly
When to perform this action.
-
#start_time ⇒ DateTime?
readonly
When this scheduled action becomes active.
-
#time_zone ⇒ String?
readonly
Specifies the time zone for a cron expression.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schedule:, desired_capacity: nil, end_time: nil, max_capacity: nil, min_capacity: nil, start_time: nil, time_zone: nil) ⇒ BasicScheduledActionProps
constructor
A new instance of BasicScheduledActionProps.
- #to_jsii ⇒ Object
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.
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_capacity ⇒ Numeric? (readonly)
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.
47 48 49 |
# File 'autoscaling/basic_scheduled_action_props.rb', line 47 def desired_capacity @desired_capacity end |
#end_time ⇒ DateTime? (readonly)
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.
56 57 58 |
# File 'autoscaling/basic_scheduled_action_props.rb', line 56 def end_time @end_time end |
#max_capacity ⇒ Numeric? (readonly)
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.
65 66 67 |
# File 'autoscaling/basic_scheduled_action_props.rb', line 65 def max_capacity @max_capacity end |
#min_capacity ⇒ Numeric? (readonly)
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.
74 75 76 |
# File 'autoscaling/basic_scheduled_action_props.rb', line 74 def min_capacity @min_capacity end |
#schedule ⇒ AWSCDK::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_time ⇒ DateTime? (readonly)
Default: - The rule is activate immediately.
When this scheduled action becomes active.
79 80 81 |
# File 'autoscaling/basic_scheduled_action_props.rb', line 79 def start_time @start_time end |
#time_zone ⇒ String? (readonly)
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.
90 91 92 |
# File 'autoscaling/basic_scheduled_action_props.rb', line 90 def time_zone @time_zone end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |