Sha256: 0d90e4eb010e476acba529250593a001eb14731fc97a89dc7d370f22739f4f6c

Contents?: true

Size: 574 Bytes

Versions: 9

Compression:

Stored size: 574 Bytes

Contents

module OpsPreflight
  module OpsWorks
    class Base
      attr_accessor :stack_name

      def initialize(stack_name)
        require 'aws-sdk'

        @stack_name = stack_name
      end

      protected
      def opsworks
        @opsworks ||= AWS::OpsWorks.new
      end

      def stack_id
        @stack_id ||= begin
          resp = opsworks.client.describe_stacks
          stack = resp[:stacks].find {|stack| stack[:name] == stack_name }

          raise "OpsWorks stack not found!" if stack.nil?

          stack[:stack_id]
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ops_preflight-1.1.2 lib/ops_preflight/ops_works/base.rb
ops_preflight-1.1.1 lib/ops_preflight/ops_works/base.rb
ops_preflight-1.1.0 lib/ops_preflight/ops_works/base.rb
ops_preflight-1.0.0.pre2 lib/ops_preflight/ops_works/base.rb
ops_preflight-1.0.0.pre1 lib/ops_preflight/ops_works/base.rb
ops_preflight-0.9.0 lib/ops_preflight/ops_works/base.rb
ops_preflight-0.9.0.pre2 lib/ops_preflight/ops_works/base.rb
ops_preflight-0.9.0.pre1 lib/ops_preflight/ops_works/base.rb
ops_preflight-0.0.1.pre lib/ops_preflight/ops_works/base.rb