Sha256: b11f5e27cfb6cd168acf39f94d3f4a0a7cec8dd0642d12f9a8f987ddf096a8ff

Contents?: true

Size: 1018 Bytes

Versions: 2

Compression:

Stored size: 1018 Bytes

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
      cloud_formation.stack_events @name
    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

2 entries across 2 versions & 1 rubygems

Version Path
stackster-0.2.1 lib/stackster/stack/stack_reader.rb
stackster-0.2.0 lib/stackster/stack/stack_reader.rb