Method: Jets::Cfn::Status#run

Defined in:
lib/jets/cfn/status.rb

#runObject

used for the jets status command



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jets/cfn/status.rb', line 13

def run
  unless stack_exists?(@stack_name)
    puts "The stack #{@stack_name.color(:green)} does not exist."
    return
  end

  resp = cfn.describe_stacks(stack_name: @stack_name)
  stack = resp.stacks.first

  puts "The current status for the stack #{@stack_name.color(:green)} is #{stack.stack_status.color(:green)}"
  if stack.stack_status =~ /_IN_PROGRESS$/
    puts "Stack events (tailing):"
    # tail all events until done
    @hide_time_took = true
    wait
  else
    puts "Stack events:"
    # show the last events that was user initiated
    refresh_events
    show_events(true)
  end
end