uc3-dmp-api-core 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-api-core/ssm_reader.rb +9 -0
- data/lib/uc3-dmp-api-core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efebb403fd0b700fb57385c2b63e66cb0aec9530b3f6b08bf3dd85dd2417aef7
|
4
|
+
data.tar.gz: 93ab1915f7db8882f065b53fc8e1616228c9b1b3d345ce68df82e26c3ad6dcf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bff15a217476c17d0dfd3985b8462b2a8ada6956ff697f8de7a574faf55a441f3cd3e9c58cdd802a902630e76cd6d24e3e80f3d6afa076049f8472ab6bce758a
|
7
|
+
data.tar.gz: 928f0bb01da885343052564b4f1bb45b483c34d7a3bc49ec88b5d5f2f5947577634beab236937802aed17f49f91d0ed9c6fcfe46f47203b11c9c6389eb372294
|
@@ -22,12 +22,18 @@ module Uc3DmpApiCore
|
|
22
22
|
# rubocop:disable Metrics/AbcSize
|
23
23
|
def get_ssm_value(key:, provenance_name: nil)
|
24
24
|
full_key = _ssm_keys[:"#{key.downcase}"] unless key.nil?
|
25
|
+
|
26
|
+
puts "FULL KEY: #{full_key}"
|
27
|
+
|
25
28
|
return nil if full_key.nil?
|
26
29
|
|
27
30
|
key_vals = { env: ENV.fetch('LAMBDA_ENV', 'dev').to_s.downcase }
|
28
31
|
# Swap in the provenance name if applicable
|
29
32
|
key_vals[:provenance] = provenance_name unless provenance_name.nil? ||
|
30
33
|
!full_key.include?('%{provenance}')
|
34
|
+
|
35
|
+
puts "KEY VALS: #{key_vals}"
|
36
|
+
|
31
37
|
fetch_value(key: format(full_key, key_vals))
|
32
38
|
rescue Aws::Errors::ServiceError => e
|
33
39
|
LogWriter.log_error(
|
@@ -40,6 +46,9 @@ module Uc3DmpApiCore
|
|
40
46
|
# Call SSM to get the value for the specified key
|
41
47
|
def fetch_value(key:)
|
42
48
|
resp = Aws::SSM::Client.new.get_parameter(name: key, with_decryption: true)
|
49
|
+
|
50
|
+
puts "FETCHING `#{key}` -- GOT: #{resp.inspect}"
|
51
|
+
|
43
52
|
resp.nil? || resp.parameter.nil? ? nil : resp.parameter.value
|
44
53
|
end
|
45
54
|
|