Class: CloudConfig::Providers::AwsParameterStore
- Inherits:
-
Object
- Object
- CloudConfig::Providers::AwsParameterStore
- Defined in:
- lib/cloud-config/providers/aws_parameter_store.rb
Overview
A class for fetching configuration from the AWS Parameter Store
Instance Attribute Summary collapse
- #An instance of the AWS Parameter Store client(instanceoftheAWSParameterStoreclient) ⇒ Aws::SSM::Client readonly
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#get(key) ⇒ String
Fetch the value of the key.
-
#initialize(_params = {}) ⇒ AwsParameterStore
constructor
Create a new instance of AwsParameterStore.
-
#set(key, value) ⇒ Object
Set the value of the key.
Constructor Details
#initialize(_params = {}) ⇒ AwsParameterStore
Create a new instance of CloudConfig::Providers::AwsParameterStore.
17 18 19 |
# File 'lib/cloud-config/providers/aws_parameter_store.rb', line 17 def initialize(_params = {}) @client = Aws::SSM::Client.new end |
Instance Attribute Details
#An instance of the AWS Parameter Store client(instanceoftheAWSParameterStoreclient) ⇒ Aws::SSM::Client (readonly)
14 |
# File 'lib/cloud-config/providers/aws_parameter_store.rb', line 14 attr_reader :client |
#client ⇒ Object (readonly)
Returns the value of attribute client.
14 15 16 |
# File 'lib/cloud-config/providers/aws_parameter_store.rb', line 14 def client @client end |
Instance Method Details
#get(key) ⇒ String
Fetch the value of the key
26 27 28 |
# File 'lib/cloud-config/providers/aws_parameter_store.rb', line 26 def get(key) client.get_parameter(name: key).parameter.value end |
#set(key, value) ⇒ Object
Set the value of the key
34 35 36 |
# File 'lib/cloud-config/providers/aws_parameter_store.rb', line 34 def set(key, value) client.put_parameter(name: key, value:) end |