Sha256: f01a3fb880dd30665df8f7d84ae757fbba0affe3c33dbd20ab462235f85a7f46

Contents?: true

Size: 987 Bytes

Versions: 24

Compression:

Stored size: 987 Bytes

Contents

module SimpleDeploy
  class StackReader

    def initialize(args)
      @name = args[:name]
      @config = SimpleDeploy.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
    end

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

    def instance_reader
      @instance_reader ||= AWS::InstanceReader.new
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
simple_deploy-0.7.6.beta.1 lib/simple_deploy/stack/stack_reader.rb
simple_deploy-0.7.5 lib/simple_deploy/stack/stack_reader.rb
simple_deploy-0.7.4 lib/simple_deploy/stack/stack_reader.rb
simple_deploy-0.7.3 lib/simple_deploy/stack/stack_reader.rb