Class: Awry::Ssm
Instance Method Summary collapse
Instance Method Details
#delete(name) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/awry/ssm.rb', line 47 def delete(name) if yes?("Really delete parameter #{name}?", :yellow) client.delete_parameter(name: name) end rescue Aws::SSM::Errors::ParameterNotFound => e error(e.) end |
#get(name) ⇒ Object
22 23 24 25 26 |
# File 'lib/awry/ssm.rb', line 22 def get(name) puts client.get_parameter(name: name, with_decryption: [:decrypt]).parameter.value rescue Aws::SSM::Errors::ParameterNotFound => e error(e.) end |
#ls(prefix = '/') ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/awry/ssm.rb', line 12 def ls(prefix = '/') filters = [ { key: :Name, option: :BeginsWith, values: [ prefix.sub(/^(\w)/, '/\1') ] } ] client.describe_parameters(parameter_filters: filters).each do |response| response.parameters.each { |p| puts p.name } sleep 0.1 # this api will throttle easily end end |
#put(name, value) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/awry/ssm.rb', line 33 def put(name, value) client.put_parameter( name: name, value: value, description: [:description], type: [:type], key_id: [:key_id], overwrite: [:overwrite], ) rescue Aws::SSM::Errors::ParameterAlreadyExists => e error(e.) end |