Sha256: 2cdeac5cc0442ce31b13ca7c2c1ca6d57376091011ccb4817dba157685e24a33

Contents?: true

Size: 428 Bytes

Versions: 48

Compression:

Stored size: 428 Bytes

Contents

require 'aws-sdk-ssm'

class Lono::Template::Context
  class SsmFetcher
    extend Memoist

    def get(name)
      fetch_ssm_value(name)
    end

    def fetch_ssm_value(name)
      resp = ssm.get_parameter(name: name, with_decryption: true)
      resp.parameter.value
    rescue Aws::SSM::Errors::ParameterNotFound
      'SSM-PARAM-NOT-FOUND'
    end

    def ssm
      Aws::SSM::Client.new
    end
    memoize :ssm
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
lono-6.1.0 lib/lono/template/context/ssm_fetcher.rb
lono-6.0.1 lib/lono/template/context/ssm_fetcher.rb
lono-6.0.0 lib/lono/template/context/ssm_fetcher.rb
lono-5.3.4 lib/lono/template/context/ssm_fetcher.rb
lono-5.3.3 lib/lono/template/context/ssm_fetcher.rb
lono-5.3.2 lib/lono/template/context/ssm_fetcher.rb
lono-5.3.1 lib/lono/template/context/ssm_fetcher.rb
lono-5.3.0 lib/lono/template/context/ssm_fetcher.rb