Class: Global::Backend::AwsParameterStore
- Inherits:
-
Object
- Object
- Global::Backend::AwsParameterStore
- Defined in:
- lib/global/backend/aws_parameter_store.rb
Overview
Loads Global configuration from the AWS Systems Manager Parameter Store docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html
This backend requires the ‘aws-sdk` or `aws-sdk-ssm` gem, so make sure to add it to your Gemfile.
Available options:
-
‘prefix` (required): the prefix in Parameter Store; all parameters within the prefix will be loaded; make sure to add a trailing slash, if you want it see docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-su-organize.html
-
‘client`: pass you own Aws::SSM::Client instance, or alternatively set:
-
‘aws_options`: credentials and other AWS configuration options that are passed to AWS::SSM::Client.new see docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SSM/Client.html#initialize-instance_method If AWS access is already configured through environment variables, you don’t need to pass the credentials explicitly.
For Rails:
-
the ‘prefix` is optional and defaults to `/[Rails enviroment]/[Name of the app class]/`,
for example: `/production/MyApp/`
-
to use a different app name, pass ‘app_name`,
for example: `backend :aws_parameter_store, app_name: 'new_name_for_my_app'`
Constant Summary collapse
- PATH_SEPARATOR =
'/'
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AwsParameterStore
constructor
A new instance of AwsParameterStore.
- #load ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ AwsParameterStore
Returns a new instance of AwsParameterStore.
29 30 31 32 33 |
# File 'lib/global/backend/aws_parameter_store.rb', line 29 def initialize( = {}) require_aws_gem init_prefix() init_client() end |
Instance Method Details
#load ⇒ Object
35 36 37 |
# File 'lib/global/backend/aws_parameter_store.rb', line 35 def load build_configuration_from_parameters(load_all_parameters_from_ssm) end |