Class: Itamae::Aws::Parameterstore::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/itamae/aws/parameterstore/store.rb

Instance Method Summary collapse

Constructor Details

#initializeStore

Returns a new instance of Store.



9
10
11
# File 'lib/itamae/aws/parameterstore/store.rb', line 9

def initialize
  @client = ::Aws::SSM::Client.new
end

Instance Method Details

#[](name) ⇒ Object



13
14
15
# File 'lib/itamae/aws/parameterstore/store.rb', line 13

def [](name)
  get_parameter_value(name)
end

#get_parameter_value(name) ⇒ Object



17
18
19
20
21
22
# File 'lib/itamae/aws/parameterstore/store.rb', line 17

def get_parameter_value(name)
  @client.get_parameter({
    name: name.to_s,
    with_decryption: true,
  }).parameter.value
end