Class: CuffSert::UpdateStackAction

Inherits:
BaseAction show all
Defined in:
lib/cuffsert/actions.rb

Instance Attribute Summary

Attributes inherited from BaseAction

#cfclient, #confirmation, #s3client

Instance Method Summary collapse

Methods inherited from BaseAction

#initialize, #upload_template_if_oversized

Constructor Details

This class inherits a constructor from CuffSert::BaseAction

Instance Method Details

#as_observableObject



88
89
90
91
92
93
94
95
# File 'lib/cuffsert/actions.rb', line 88

def as_observable
  cfargs = CuffSert.as_update_change_set(@meta, @stack)
  upload_uri, maybe_upload = upload_template_if_oversized(cfargs)
  cfargs[:template_url] = upload_uri if upload_uri
  maybe_upload
    .concat(prepare_update(cfargs))
    .flat_map(&method(:on_event))
end

#validate!Object



80
81
82
83
84
85
86
# File 'lib/cuffsert/actions.rb', line 80

def validate!
  if @meta.stack_uri.nil?
    if @meta.parameters.empty? && @meta.tags.empty?
      raise "Stack update without template needs at least one parameter (-p) or tag (-t)."
    end
  end
end