Class: Global::Backend::AwsParameterStore

Inherits:
Object
  • Object
show all
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:

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

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(options = {})
  require_aws_gem
  init_prefix(options)
  init_client(options)
end

Instance Method Details

#loadObject



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