Class: Convection::Model::Template::ResourceAttribute::UpdatePolicy

Inherits:
Convection::Model::Template::ResourceAttribute show all
Defined in:
lib/convection/model/template/resource_attribute/update_policy.rb

Overview

Instance Method Summary collapse

Methods inherited from Convection::Model::Template::ResourceAttribute

#initialize

Constructor Details

This class inherits a constructor from Convection::Model::Template::ResourceAttribute

Instance Method Details

#max_batch_size(val) ⇒ Object



21
22
23
# File 'lib/convection/model/template/resource_attribute/update_policy.rb', line 21

def max_batch_size(val)
  @max_batch = val
end

#min_instances_in_service(val) ⇒ Object



17
18
19
# File 'lib/convection/model/template/resource_attribute/update_policy.rb', line 17

def min_instances_in_service(val)
  @min_in_service = val
end

#pause_time(val) ⇒ Object



13
14
15
# File 'lib/convection/model/template/resource_attribute/update_policy.rb', line 13

def pause_time(val)
  @pause = val
end

#render(resource) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/convection/model/template/resource_attribute/update_policy.rb', line 25

def render(resource)
  resource.tap do |r|
    r['UpdatePolicy'] = {
      'AutoScalingScheduledAction' => {
        'IgnoreUnmodifiedGroupSizeProperties' => true
      },
      'AutoScalingRollingUpdate' => {
        'MinInstancesInService' => @min_in_service,
        'MaxBatchSize' => @max_batch,
        'WaitOnResourceSignals' => false,
        'PauseTime' => @pause
      }
    }
  end
end