Class: Asg::Rebooter::Configuration::AutoScalingGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/asg/rebooter/configuration/auto_scaling_group.rb

Constant Summary collapse

ASG_MIN_SIZE_DELTA =
1
AZREBALANCE =
'AZRebalance'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asg) ⇒ AutoScalingGroup

Returns a new instance of AutoScalingGroup.



10
11
12
13
14
# File 'lib/asg/rebooter/configuration/auto_scaling_group.rb', line 10

def initialize(asg)
  @asg = asg

  set_original_values
end

Instance Attribute Details

#asgObject (readonly)

Returns the value of attribute asg.



8
9
10
# File 'lib/asg/rebooter/configuration/auto_scaling_group.rb', line 8

def asg
  @asg
end

#original_min_sizeObject (readonly)

Returns the value of attribute original_min_size.



8
9
10
# File 'lib/asg/rebooter/configuration/auto_scaling_group.rb', line 8

def original_min_size
  @original_min_size
end

#original_suspended_processesObject (readonly)

Returns the value of attribute original_suspended_processes.



8
9
10
# File 'lib/asg/rebooter/configuration/auto_scaling_group.rb', line 8

def original_suspended_processes
  @original_suspended_processes
end

Instance Method Details

#prepareObject



16
17
18
19
# File 'lib/asg/rebooter/configuration/auto_scaling_group.rb', line 16

def prepare
  suspend_az_rebalance
  decrease_min_size
end

#restoreObject



21
22
23
24
# File 'lib/asg/rebooter/configuration/auto_scaling_group.rb', line 21

def restore
  restore_az_rebalance
  restore_min_size
end