Class: AWSCDK::Autoscaling::CfnScheduledActionProps

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

Overview

Properties for defining a CfnScheduledAction.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auto_scaling_group_name:, desired_capacity: nil, end_time: nil, max_size: nil, min_size: nil, recurrence: nil, start_time: nil, time_zone: nil) ⇒ CfnScheduledActionProps

Returns a new instance of CfnScheduledActionProps.

Parameters:

  • auto_scaling_group_name (String, AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef)

    The name of the Auto Scaling group.

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

    The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.

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

    The date and time for the recurring schedule to end, in UTC.

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

    The maximum size of the Auto Scaling group.

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

    The minimum size of the Auto Scaling group.

  • recurrence (String, nil) (defaults to: nil)

    The recurring schedule for this action.

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

    The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, "2021-06-01T00:00:00Z" ).

  • time_zone (String, nil) (defaults to: nil)

    Specifies the time zone for a cron expression.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'autoscaling/cfn_scheduled_action_props.rb', line 17

def initialize(auto_scaling_group_name:, desired_capacity: nil, end_time: nil, max_size: nil, min_size: nil, recurrence: nil, start_time: nil, time_zone: nil)
  @auto_scaling_group_name = auto_scaling_group_name
  Jsii::Type.check_type(@auto_scaling_group_name, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hdXRvc2NhbGluZy5JQXV0b1NjYWxpbmdHcm91cFJlZiJ9XX19")), "autoScalingGroupName")
  @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("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endTime") unless @end_time.nil?
  @max_size = max_size
  Jsii::Type.check_type(@max_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxSize") unless @max_size.nil?
  @min_size = min_size
  Jsii::Type.check_type(@min_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minSize") unless @min_size.nil?
  @recurrence = recurrence
  Jsii::Type.check_type(@recurrence, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "recurrence") unless @recurrence.nil?
  @start_time = start_time
  Jsii::Type.check_type(@start_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "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

#auto_scaling_group_nameString, AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef (readonly)

The name of the Auto Scaling group.



40
41
42
# File 'autoscaling/cfn_scheduled_action_props.rb', line 40

def auto_scaling_group_name
  @auto_scaling_group_name
end

#desired_capacityNumeric? (readonly)

The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain.

It can scale beyond this capacity if you add more scaling conditions.

You must specify at least one of the following properties: MaxSize , MinSize , or DesiredCapacity .



49
50
51
# File 'autoscaling/cfn_scheduled_action_props.rb', line 49

def desired_capacity
  @desired_capacity
end

#end_timeString? (readonly)

The date and time for the recurring schedule to end, in UTC.

For example, "2021-06-01T00:00:00Z" .



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

def end_time
  @end_time
end

#max_sizeNumeric? (readonly)

The maximum size of the Auto Scaling group.



61
62
63
# File 'autoscaling/cfn_scheduled_action_props.rb', line 61

def max_size
  @max_size
end

#min_sizeNumeric? (readonly)

The minimum size of the Auto Scaling group.



66
67
68
# File 'autoscaling/cfn_scheduled_action_props.rb', line 66

def min_size
  @min_size
end

#recurrenceString? (readonly)

The recurring schedule for this action.

This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, "30 0 1 1,6,12 *" ). For more information about this format, see Crontab .

When StartTime and EndTime are specified with Recurrence , they form the boundaries of when the recurring action starts and stops.

Cron expressions use Universal Coordinated Time (UTC) by default.



77
78
79
# File 'autoscaling/cfn_scheduled_action_props.rb', line 77

def recurrence
  @recurrence
end

#start_timeString? (readonly)

The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, "2021-06-01T00:00:00Z" ).

If you specify Recurrence and StartTime , Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.



84
85
86
# File 'autoscaling/cfn_scheduled_action_props.rb', line 84

def start_time
  @start_time
end

#time_zoneString? (readonly)

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/cfn_scheduled_action_props.rb', line 93

def time_zone
  @time_zone
end

Class Method Details

.jsii_propertiesObject



95
96
97
98
99
100
101
102
103
104
105
106
# File 'autoscaling/cfn_scheduled_action_props.rb', line 95

def self.jsii_properties
  {
    :auto_scaling_group_name => "autoScalingGroupName",
    :desired_capacity => "desiredCapacity",
    :end_time => "endTime",
    :max_size => "maxSize",
    :min_size => "minSize",
    :recurrence => "recurrence",
    :start_time => "startTime",
    :time_zone => "timeZone",
  }
end

Instance Method Details

#to_jsiiObject



108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'autoscaling/cfn_scheduled_action_props.rb', line 108

def to_jsii
  result = {}
  result.merge!({
    "autoScalingGroupName" => @auto_scaling_group_name,
    "desiredCapacity" => @desired_capacity,
    "endTime" => @end_time,
    "maxSize" => @max_size,
    "minSize" => @min_size,
    "recurrence" => @recurrence,
    "startTime" => @start_time,
    "timeZone" => @time_zone,
  })
  result.compact
end