ssm_params_loader 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8a68deb19396ec5e6408a733d2a279d499b9c71adba02fa75f7f3b4d812f4ce
4
- data.tar.gz: 023eb7cce06eb9de920f90e0ea504fd66a764bc8a55c6f0bf92c4513588e95d9
3
+ metadata.gz: e5ebdf049efcb5bb6b26c4c05f7530592a477047f5aec5f5f90b2d1352cf3b5f
4
+ data.tar.gz: d468f77006bcba68a1ad413eb7ac333ffc254af39008e04ab28d247c4dde8ab2
5
5
  SHA512:
6
- metadata.gz: a5e8eb20335f4443fcf1410ab51679c67a0b1f3f63f6d26ccfe74f2f2cda33439a010983462922fdc75529a660dc6f41479cfc65d6ad171cb096453f05477ac8
7
- data.tar.gz: 1202103d4d03b52059df4c126d48f0c87d5f3119d9696a6f461d542202903b75e220745bff551b0ef2c4e9687a6526dcb92f92699baa0a30528e047ceec422ac
6
+ metadata.gz: ec4fdd361fc040466d20106c3b2d5b5e7751ea0f2a616b06c7d0f518fc66d42780c33d41514a587424ae126d930ed7d81d96a29b1cc6f229957ec01581d2d791
7
+ data.tar.gz: 1257e44df91a296521cbedbeaacd3478f26117806930852bfeb58553ab5e8ff6fa1b712fbdd46286f1c1296dfdd6e077a8ed70cf0f2437028ed981831cf086a4
@@ -1,5 +1,9 @@
1
1
  # Path to a SSM parameters
2
- ssm_store_path: '' # Ex: /MyApp/production
2
+ # The lower the position in the list, the higher the priority
3
+ # of two parameters with the same name, the one received last will be used
4
+ ssm_store_paths: [ ]
5
+ # - /Shared/production
6
+ # - /MyApp/production
3
7
 
4
8
  # Additional static secrets list
5
9
  # If a name is equal to a name obtained from the SSM, the value from the SSM
@@ -12,11 +12,11 @@ module SsmParamsLoader
12
12
 
13
13
  config = YAML.safe_load_file(config_file).with_indifferent_access
14
14
 
15
- ssm_path = config[:ssm_store_path] || nil
15
+ ssm_paths = config[:ssm_store_paths] || nil
16
16
  additional = config[:additional_vars] || nil
17
17
 
18
18
  # Get secrets and set environment variables
19
- environments = load_secrets(ssm_path, additional)
19
+ environments = load_secrets(ssm_paths, additional)
20
20
  environments.each { |secret| ENV["SSM_#{secret[:name].gsub('-', '_').upcase}"] = secret[:value] }
21
21
  end
22
22
 
@@ -28,11 +28,14 @@ module SsmParamsLoader
28
28
  end
29
29
 
30
30
  # Get a hash array of secrets
31
- def self.load_secrets(ssm_path, additional)
31
+ def self.load_secrets(ssm_paths, additional)
32
32
  secrets = []
33
33
 
34
- unless ssm_path.nil?
35
- secrets += from_ssm(ssm_path)
34
+ unless ssm_paths.nil?
35
+ ssm_paths.each do |path|
36
+ puts path
37
+ secrets += from_ssm(path)
38
+ end
36
39
  end
37
40
 
38
41
  unless additional.nil?
@@ -1,3 +1,3 @@
1
1
  module SsmParamsLoader
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssm_params_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleksii Samoliuk