Class: Bora::Cfn::StackStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/bora/cfn/stack_status.rb

Instance Method Summary collapse

Constructor Details

#initialize(underlying_stack) ⇒ StackStatus

Returns a new instance of StackStatus.



7
8
9
10
11
12
# File 'lib/bora/cfn/stack_status.rb', line 7

def initialize(underlying_stack)
  @stack = underlying_stack
  if @stack
    @status = Status.new(@stack.stack_status)
  end
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/bora/cfn/stack_status.rb', line 14

def exists?
  @status && !@status.deleted?
end

#success?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/bora/cfn/stack_status.rb', line 18

def success?
  @status && @status.success?
end

#to_sObject



22
23
24
25
26
27
28
29
# File 'lib/bora/cfn/stack_status.rb', line 22

def to_s
  if @stack
    status_reason = @stack.stack_status_reason ? " - #{@stack.stack_status_reason}" : ""
    "#{@stack.stack_name} - #{@status}#{status_reason}"
  else
    "Stack does not exist"
  end
end