Sha256: 1326900d6760f9dc09e4abf2333bbeef80de91562f5a7b7d025cc929dc73d4c1

Contents?: true

Size: 600 Bytes

Versions: 2

Compression:

Stored size: 600 Bytes

Contents

class Lono::Cfn::Deploy
  class Operable < Base
    def check!
      status = stack_status
      unless status =~ /_COMPLETE$/ || status == "UPDATE_ROLLBACK_FAILED"
        logger.info "Cannot run operation on stack #{@stack} is not in an updatable state.  Stack status: #{status}".color(:red)
        quit 1
      end
    end

    # All CloudFormation states listed here:
    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html
    def stack_status
      resp = cfn.describe_stacks(stack_name: @stack)
      resp.stacks[0].stack_status
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc6 lib/lono/cfn/deploy/operable.rb
lono-8.0.0.pre.rc5 lib/lono/cfn/deploy/operable.rb