Method: Sfn::Command::Inspect#execute!

Defined in:
lib/sfn/command/inspect.rb

#execute!Object

Run the stack inspection action



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/sfn/command/inspect.rb', line 11

def execute!
  name_required!
  stack_name = name_args.last
  stack = provider.stack(stack_name)
  ui.info "Stack inspection #{ui.color(stack_name, :bold)}:"
  outputs = api_action!(:api_stack => stack) do
    [:attribute, :nodes, :load_balancers, :instance_failure].map do |key|
      if config.has_key?(key)
        send("display_#{key}", stack)
        key
      end
    end.compact
  end
  if outputs.empty?
    ui.info "  Stack dump:"
    ui.puts MultiJson.dump(
      MultiJson.load(
        stack.reload.to_json
      ),
      :pretty => true,
    )
  end
end