Sha256: 35c68a64be2467eaad04ad0666ec80c049889d1a4ad982cf5969794e3f7c3367

Contents?: true

Size: 1.29 KB

Versions: 43

Compression:

Stored size: 1.29 KB

Contents

require_relative '../resource_attribute'

module Convection
  module Model
    class Template
      class ResourceAttribute
        # Represents {http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html}
        class UpdatePolicy < ResourceAttribute
          @pause = 'PT5M'
          @min_in_service = 0
          @max_batch = 1
          @wait_on_res = false

          def pause_time(val)
            @pause = val
          end

          def min_instances_in_service(val)
            @min_in_service = val
          end

          def max_batch_size(val)
            @max_batch = val
          end

          def wait_on_resource_signals(val)
            @wait_on_res = val
          end

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

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
convection-2.3.1 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.3.0 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.29 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.28.pre.beta.2 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.28.pre.beta.1 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.27 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.26 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.25 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.24 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.23 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.22 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.21 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.20 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.19 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.18 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.17 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.16 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.15 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.14 lib/convection/model/template/resource_attribute/update_policy.rb
convection-2.2.13 lib/convection/model/template/resource_attribute/update_policy.rb