Class: AWSCDK::Autoscaling::ScheduledActionProps
- Inherits:
-
BasicScheduledActionProps
- Object
- BasicScheduledActionProps
- AWSCDK::Autoscaling::ScheduledActionProps
- Defined in:
- autoscaling/scheduled_action_props.rb
Overview
Properties for a scheduled action on an AutoScalingGroup.
Instance Attribute Summary collapse
-
#auto_scaling_group ⇒ AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef
readonly
The AutoScalingGroup to apply the scheduled actions to.
-
#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, auto_scaling_group:) ⇒ ScheduledActionProps
constructor
A new instance of ScheduledActionProps.
- #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, auto_scaling_group:) ⇒ ScheduledActionProps
Returns a new instance of ScheduledActionProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'autoscaling/scheduled_action_props.rb', line 15 def initialize(schedule:, desired_capacity: nil, end_time: nil, max_capacity: nil, min_capacity: nil, start_time: nil, time_zone: nil, auto_scaling_group:) @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? @auto_scaling_group = auto_scaling_group Jsii::Type.check_type(@auto_scaling_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hdXRvc2NhbGluZy5JQXV0b1NjYWxpbmdHcm91cFJlZiJ9")), "autoScalingGroup") end |
Instance Attribute Details
#auto_scaling_group ⇒ AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef (readonly)
The AutoScalingGroup to apply the scheduled actions to.
97 98 99 |
# File 'autoscaling/scheduled_action_props.rb', line 97 def auto_scaling_group @auto_scaling_group end |
#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.
50 51 52 |
# File 'autoscaling/scheduled_action_props.rb', line 50 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.
59 60 61 |
# File 'autoscaling/scheduled_action_props.rb', line 59 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.
68 69 70 |
# File 'autoscaling/scheduled_action_props.rb', line 68 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.
77 78 79 |
# File 'autoscaling/scheduled_action_props.rb', line 77 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.
41 42 43 |
# File 'autoscaling/scheduled_action_props.rb', line 41 def schedule @schedule end |
#start_time ⇒ DateTime? (readonly)
Default: - The rule is activate immediately.
When this scheduled action becomes active.
82 83 84 |
# File 'autoscaling/scheduled_action_props.rb', line 82 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.
93 94 95 |
# File 'autoscaling/scheduled_action_props.rb', line 93 def time_zone @time_zone end |
Class Method Details
.jsii_properties ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'autoscaling/scheduled_action_props.rb', line 99 def self.jsii_properties { :schedule => "schedule", :desired_capacity => "desiredCapacity", :end_time => "endTime", :max_capacity => "maxCapacity", :min_capacity => "minCapacity", :start_time => "startTime", :time_zone => "timeZone", :auto_scaling_group => "autoScalingGroup", } end |
Instance Method Details
#to_jsii ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'autoscaling/scheduled_action_props.rb', line 112 def to_jsii result = {} result.merge!(super) result.merge!({ "schedule" => @schedule, "desiredCapacity" => @desired_capacity, "endTime" => @end_time, "maxCapacity" => @max_capacity, "minCapacity" => @min_capacity, "startTime" => @start_time, "timeZone" => @time_zone, "autoScalingGroup" => @auto_scaling_group, }) result.compact end |