Class: AWSCDK::ApplicationAutoScaling::CfnScalableTarget::ScheduledActionProperty

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

Overview

ScheduledAction is a property of the AWS::ApplicationAutoScaling::ScalableTarget resource that specifies a scheduled action for a scalable target.

For more information, see Scheduled scaling in the Application Auto Scaling User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schedule:, scheduled_action_name:, end_time: nil, scalable_target_action: nil, start_time: nil, timezone: nil) ⇒ ScheduledActionProperty

Returns a new instance of ScheduledActionProperty.

Parameters:

  • schedule (String)

    The schedule for this action. The following formats are supported:.

  • scheduled_action_name (String)

    The name of the scheduled action.

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

    The date and time that the action is scheduled to end, in UTC.

  • scalable_target_action (AWSCDK::IResolvable, AWSCDK::ApplicationAutoScaling::CfnScalableTarget::ScalableTargetActionProperty, nil) (defaults to: nil)

    The new minimum and maximum capacity.

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

    The date and time that the action is scheduled to begin, in UTC.

  • timezone (String, 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.



651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'application_auto_scaling/cfn_scalable_target.rb', line 651

def initialize(schedule:, scheduled_action_name:, end_time: nil, scalable_target_action: nil, start_time: nil, timezone: nil)
  @schedule = schedule
  Jsii::Type.check_type(@schedule, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "schedule")
  @scheduled_action_name = scheduled_action_name
  Jsii::Type.check_type(@scheduled_action_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scheduledActionName")
  @end_time = end_time
  Jsii::Type.check_type(@end_time, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiZGF0ZSJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "endTime") unless @end_time.nil?
  @scalable_target_action = scalable_target_action.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalableTarget::ScalableTargetActionProperty.new(**scalable_target_action.transform_keys(&:to_sym)) : scalable_target_action
  Jsii::Type.check_type(@scalable_target_action, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxhYmxlVGFyZ2V0LlNjYWxhYmxlVGFyZ2V0QWN0aW9uUHJvcGVydHkifV19fQ==")), "scalableTargetAction") unless @scalable_target_action.nil?
  @start_time = start_time
  Jsii::Type.check_type(@start_time, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiZGF0ZSJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "startTime") unless @start_time.nil?
  @timezone = timezone
  Jsii::Type.check_type(@timezone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "timezone") unless @timezone.nil?
end

Instance Attribute Details

#end_timeDateTime, ... (readonly)

The date and time that the action is scheduled to end, in UTC.



694
695
696
# File 'application_auto_scaling/cfn_scalable_target.rb', line 694

def end_time
  @end_time
end

#scalable_target_actionAWSCDK::IResolvable, ... (readonly)

The new minimum and maximum capacity.

You can set both values or just one. At the scheduled time, if the current capacity is below the minimum capacity, Application Auto Scaling scales out to the minimum capacity. If the current capacity is above the maximum capacity, Application Auto Scaling scales in to the maximum capacity.



701
702
703
# File 'application_auto_scaling/cfn_scalable_target.rb', line 701

def scalable_target_action
  @scalable_target_action
end

#scheduleString (readonly)

The schedule for this action. The following formats are supported:.

  • At expressions - " at( *yyyy* - *mm* - *dd* T *hh* : *mm* : *ss* ) "
  • Rate expressions - " rate( *value* *unit* ) "
  • Cron expressions - " cron( *fields* ) "

At expressions are useful for one-time schedules. Cron expressions are useful for scheduled actions that run periodically at a specified date and time, and rate expressions are useful for scheduled actions that run at a regular interval.

At and cron expressions use Universal Coordinated Time (UTC) by default.

The cron format consists of six fields separated by white spaces: [Minutes] [Hours] [Day_of_Month] [Month] [Day_of_Week] [Year].

For rate expressions, value is a positive integer and unit is minute | minutes | hour | hours | day | days .



682
683
684
# File 'application_auto_scaling/cfn_scalable_target.rb', line 682

def schedule
  @schedule
end

#scheduled_action_nameString (readonly)

The name of the scheduled action.

This name must be unique among all other scheduled actions on the specified scalable target.



689
690
691
# File 'application_auto_scaling/cfn_scalable_target.rb', line 689

def scheduled_action_name
  @scheduled_action_name
end

#start_timeDateTime, ... (readonly)

The date and time that the action is scheduled to begin, in UTC.



706
707
708
# File 'application_auto_scaling/cfn_scalable_target.rb', line 706

def start_time
  @start_time
end

#timezoneString? (readonly)

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.



711
712
713
# File 'application_auto_scaling/cfn_scalable_target.rb', line 711

def timezone
  @timezone
end

Class Method Details

.jsii_propertiesObject



713
714
715
716
717
718
719
720
721
722
# File 'application_auto_scaling/cfn_scalable_target.rb', line 713

def self.jsii_properties
  {
    :schedule => "schedule",
    :scheduled_action_name => "scheduledActionName",
    :end_time => "endTime",
    :scalable_target_action => "scalableTargetAction",
    :start_time => "startTime",
    :timezone => "timezone",
  }
end

Instance Method Details

#to_jsiiObject



724
725
726
727
728
729
730
731
732
733
734
735
# File 'application_auto_scaling/cfn_scalable_target.rb', line 724

def to_jsii
  result = {}
  result.merge!({
    "schedule" => @schedule,
    "scheduledActionName" => @scheduled_action_name,
    "endTime" => @end_time,
    "scalableTargetAction" => @scalable_target_action,
    "startTime" => @start_time,
    "timezone" => @timezone,
  })
  result.compact
end