Sha256: d17467aedc5c40ea0d39e1875c454ac176ac83ed2452b951a38891937b9c8a8f

Contents?: true

Size: 1.01 KB

Versions: 16

Compression:

Stored size: 1.01 KB

Contents

module Stackster
  class StackReader

    def initialize(args)
      @name = args[:name]
      @config = args[:config]
    end

    def attributes
      entry.attributes
    end

    def outputs
      cloud_formation.stack_outputs @name
    end

    def status
      cloud_formation.stack_status @name
    end

    def events(limit)
      cloud_formation.stack_events @name, limit
    end

    def resources
      cloud_formation.stack_resources @name
    end

    def template
      cloud_formation.template @name
    end

    def parameters
      json = JSON.parse template
      json['Parameters'].nil? ? [] : json['Parameters'].keys
    end

    def instances
      instance_reader.list_stack_instances @name
    end

    private

    def entry
      @entry ||= Entry.find :name => @name, :config => @config
    end

    def cloud_formation
      @cloud_formation ||= AWS::CloudFormation.new :config => @config
    end

    def instance_reader
      @instance_reader ||= InstanceReader.new :config => @config
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
stackster-0.4.4 lib/stackster/stack/stack_reader.rb
stackster-0.4.3 lib/stackster/stack/stack_reader.rb
stackster-0.4.2 lib/stackster/stack/stack_reader.rb
stackster-0.4.1 lib/stackster/stack/stack_reader.rb
stackster-0.4.0 lib/stackster/stack/stack_reader.rb
stackster-0.3.2 lib/stackster/stack/stack_reader.rb
stackster-0.3.1 lib/stackster/stack/stack_reader.rb
stackster-0.3.0 lib/stackster/stack/stack_reader.rb
stackster-0.2.9 lib/stackster/stack/stack_reader.rb
stackster-0.2.8 lib/stackster/stack/stack_reader.rb
stackster-0.2.7 lib/stackster/stack/stack_reader.rb
stackster-0.2.6 lib/stackster/stack/stack_reader.rb
stackster-0.2.5 lib/stackster/stack/stack_reader.rb
stackster-0.2.4 lib/stackster/stack/stack_reader.rb
stackster-0.2.3 lib/stackster/stack/stack_reader.rb
stackster-0.2.2 lib/stackster/stack/stack_reader.rb