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-7.5.2 lib/lono/template/context/ssm_fetcher.rb
lono-7.5.1 lib/lono/template/context/ssm_fetcher.rb
lono-7.5.0 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.11 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.10 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.9 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.8 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.7 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.6 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.5 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.4 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.3 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.2 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.1 lib/lono/template/context/ssm_fetcher.rb
lono-7.4.0 lib/lono/template/context/ssm_fetcher.rb
lono-7.3.2 lib/lono/template/context/ssm_fetcher.rb
lono-7.3.1 lib/lono/template/context/ssm_fetcher.rb
lono-7.3.0 lib/lono/template/context/ssm_fetcher.rb
lono-7.2.3 lib/lono/template/context/ssm_fetcher.rb
lono-7.2.2 lib/lono/template/context/ssm_fetcher.rb