Class: AWSCDK::Autoscaling::RollingUpdateOptions

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

Overview

Options for customizing the rolling update.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_batch_size: nil, min_instances_in_service: nil, min_success_percentage: nil, pause_time: nil, suspend_processes: nil, wait_on_resource_signals: nil) ⇒ RollingUpdateOptions

Returns a new instance of RollingUpdateOptions.

Parameters:

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

    The maximum number of instances that AWS CloudFormation updates at once.

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

    The minimum number of instances that must be in service before more instances are replaced.

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

    The percentage of instances that must signal success for the update to succeed.

  • pause_time (AWSCDK::Duration, nil) (defaults to: nil)

    The pause time after making a change to a batch of instances.

  • suspend_processes (Array<AWSCDK::Autoscaling::ScalingProcess>, nil) (defaults to: nil)

    Specifies the Auto Scaling processes to suspend during a stack update.

  • wait_on_resource_signals (Boolean, nil) (defaults to: nil)

    Specifies whether the Auto Scaling group waits on signals from new instances during an update.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'autoscaling/rolling_update_options.rb', line 13

def initialize(max_batch_size: nil, min_instances_in_service: nil, min_success_percentage: nil, pause_time: nil, suspend_processes: nil, wait_on_resource_signals: nil)
  @max_batch_size = max_batch_size
  Jsii::Type.check_type(@max_batch_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxBatchSize") unless @max_batch_size.nil?
  @min_instances_in_service = min_instances_in_service
  Jsii::Type.check_type(@min_instances_in_service, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minInstancesInService") unless @min_instances_in_service.nil?
  @min_success_percentage = min_success_percentage
  Jsii::Type.check_type(@min_success_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minSuccessPercentage") unless @min_success_percentage.nil?
  @pause_time = pause_time
  Jsii::Type.check_type(@pause_time, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "pauseTime") unless @pause_time.nil?
  @suspend_processes = suspend_processes
  Jsii::Type.check_type(@suspend_processes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hdXRvc2NhbGluZy5TY2FsaW5nUHJvY2VzcyJ9LCJraW5kIjoiYXJyYXkifX0=")), "suspendProcesses") unless @suspend_processes.nil?
  @wait_on_resource_signals = wait_on_resource_signals
  Jsii::Type.check_type(@wait_on_resource_signals, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "waitOnResourceSignals") unless @wait_on_resource_signals.nil?
end

Instance Attribute Details

#max_batch_sizeNumeric? (readonly)

Note:

Default: 1

The maximum number of instances that AWS CloudFormation updates at once.

This number affects the speed of the replacement.

Returns:

  • (Numeric, nil)


34
35
36
# File 'autoscaling/rolling_update_options.rb', line 34

def max_batch_size
  @max_batch_size
end

#min_instances_in_serviceNumeric? (readonly)

Note:

Default: 0

The minimum number of instances that must be in service before more instances are replaced.

This number affects the speed of the replacement.

Returns:

  • (Numeric, nil)


41
42
43
# File 'autoscaling/rolling_update_options.rb', line 41

def min_instances_in_service
  @min_instances_in_service
end

#min_success_percentageNumeric? (readonly)

Note:

Default: - The minSuccessPercentage configured for signals on the AutoScalingGroup

The percentage of instances that must signal success for the update to succeed.

Returns:

  • (Numeric, nil)


46
47
48
# File 'autoscaling/rolling_update_options.rb', line 46

def min_success_percentage
  @min_success_percentage
end

#pause_timeAWSCDK::Duration? (readonly)

Note:

Default: - The timeout configured for signals on the AutoScalingGroup

The pause time after making a change to a batch of instances.

Returns:



51
52
53
# File 'autoscaling/rolling_update_options.rb', line 51

def pause_time
  @pause_time
end

#suspend_processesArray<AWSCDK::Autoscaling::ScalingProcess>? (readonly)

Note:

Default: HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions.

Specifies the Auto Scaling processes to suspend during a stack update.

Suspending processes prevents Auto Scaling from interfering with a stack update.

Returns:



59
60
61
# File 'autoscaling/rolling_update_options.rb', line 59

def suspend_processes
  @suspend_processes
end

#wait_on_resource_signalsBoolean? (readonly)

Note:

Default: true if you configured signals on the AutoScalingGroup, false otherwise

Specifies whether the Auto Scaling group waits on signals from new instances during an update.

Returns:

  • (Boolean, nil)


64
65
66
# File 'autoscaling/rolling_update_options.rb', line 64

def wait_on_resource_signals
  @wait_on_resource_signals
end

Class Method Details

.jsii_propertiesObject



66
67
68
69
70
71
72
73
74
75
# File 'autoscaling/rolling_update_options.rb', line 66

def self.jsii_properties
  {
    :max_batch_size => "maxBatchSize",
    :min_instances_in_service => "minInstancesInService",
    :min_success_percentage => "minSuccessPercentage",
    :pause_time => "pauseTime",
    :suspend_processes => "suspendProcesses",
    :wait_on_resource_signals => "waitOnResourceSignals",
  }
end

Instance Method Details

#to_jsiiObject



77
78
79
80
81
82
83
84
85
86
87
88
# File 'autoscaling/rolling_update_options.rb', line 77

def to_jsii
  result = {}
  result.merge!({
    "maxBatchSize" => @max_batch_size,
    "minInstancesInService" => @min_instances_in_service,
    "minSuccessPercentage" => @min_success_percentage,
    "pauseTime" => @pause_time,
    "suspendProcesses" => @suspend_processes,
    "waitOnResourceSignals" => @wait_on_resource_signals,
  })
  result.compact
end