Sha256: 854eb40ac3692bf905cf9d4a13c2332249763ca426e9590aa4bed1cab40a787c

Contents?: true

Size: 380 Bytes

Versions: 1

Compression:

Stored size: 380 Bytes

Contents

module Tagenv
  class Env
    def self.load(prefix: '', instance_id: nil, provider: 'ec2')
      tag_hash = {}
      if provider == 'ec2'
        @ec2_tag = Ec2::Tag.new
        tag_hash = @ec2_tag.get_tag_hash(instance_id)
      else
        raise "Unsupport provider [#{provider}]"
      end
      tag_hash.each do |k, v|
        ENV[prefix + k] = v
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tagenv-0.1.1 lib/tagenv/env.rb