Sha256: b628efafb64eec427313eac51b7c7c18c27708557b12cc0c1ad230a3421f38f1
Contents?: true
Size: 858 Bytes
Versions: 1
Compression:
Stored size: 858 Bytes
Contents
module ParamStore module Adapters class SSM def fetch(key, *args, &block) tmp = {} key = "#{ParamStore.path}#{key}" unless ParamStore.path.nil? begin tmp[key] = ParamStore.ssm_client.get_parameter(name: key, with_decryption: true).parameter.value rescue Aws::SSM::Errors::ParameterNotFound # let the tmp.fetch below deal with not found key and defaults end tmp.fetch(key, *args, &block) end def fetch_all(*keys) keys = keys.flatten keys = keys.map { |key| "#{ParamStore.path}#{key}" } if ParamStore.path ParamStore.ssm_client.get_parameters(names: keys, with_decryption: true).parameters.each_with_object({}) do |param, result| result[param.name.gsub(ParamStore.path.to_s, '')] = param.value end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
param_store-0.0.1 | lib/param_store/adapters/ssm.rb |