aws-sesocio-secrets 0.1.13 → 0.1.17

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: 0c3d5377a39454c9d2fd45c650eb08167b8b9893f10546cb0aa5da9e64b7ad44
4
- data.tar.gz: 6ed31f6748095d440dd5403d308cce7287da8944febb4490fb9bd7297c03e688
3
+ metadata.gz: 43cafab1821809e54353d6eb739fb5c3fb248b32464aadc331fe74f2f29f6645
4
+ data.tar.gz: e945228bdeb8a521663d1126f59bd9b9f5cd89c283aea486d504d83cc3434e81
5
5
  SHA512:
6
- metadata.gz: 44aff9fb233cda0a685f1308cd9b2434620e850cea43fa4c579355b264765359665d1193ddc01681230d89c1c843faaf6666f6b62b06be0dbb185f2e5bcbf883
7
- data.tar.gz: c035c53239d16b813214614347449b52af76bee36a257051533ef60bdbbdb1a6a3a447157235cc52316272affccdbbe3522f5af959c5a44cab8277d5a8d748bd
6
+ metadata.gz: b68b6def98115c29639bfbb9892dc685e16dd40d3a7f21d7989118d9f43f7893a6d39dae80b9cc5a16ea7f471d359411a319a04e199c24657c5e2c70bcb908e9
7
+ data.tar.gz: 919ca1448fe8fa1ca53737f8f0fba3d81bca7740c55b7e05c9c6fd3d8eafec03e845d5eb420eb8e3cc7513f346019f40c0251171a29b35e81482b1b848355725
data/Gemfile CHANGED
@@ -9,5 +9,5 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.10"
11
11
 
12
-
12
+ gem 'aws-sdk'
13
13
  gem "aws-sdk-secretsmanager"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aws-sesocio-secrets (0.1.1)
4
+ aws-sesocio-secrets (0.1.14)
5
5
  aws-sdk
6
6
 
7
7
  GEM
@@ -29,13 +29,13 @@ GEM
29
29
  aws-sdk-amplifybackend (1.7.0)
30
30
  aws-sdk-core (~> 3, >= 3.119.0)
31
31
  aws-sigv4 (~> 1.1)
32
- aws-sdk-apigateway (1.64.0)
32
+ aws-sdk-apigateway (1.65.0)
33
33
  aws-sdk-core (~> 3, >= 3.119.0)
34
34
  aws-sigv4 (~> 1.1)
35
35
  aws-sdk-apigatewaymanagementapi (1.23.0)
36
36
  aws-sdk-core (~> 3, >= 3.119.0)
37
37
  aws-sigv4 (~> 1.1)
38
- aws-sdk-apigatewayv2 (1.34.0)
38
+ aws-sdk-apigatewayv2 (1.35.0)
39
39
  aws-sdk-core (~> 3, >= 3.119.0)
40
40
  aws-sigv4 (~> 1.1)
41
41
  aws-sdk-appconfig (1.16.0)
@@ -217,7 +217,7 @@ GEM
217
217
  aws-sdk-costexplorer (1.64.0)
218
218
  aws-sdk-core (~> 3, >= 3.119.0)
219
219
  aws-sigv4 (~> 1.1)
220
- aws-sdk-customerprofiles (1.9.0)
220
+ aws-sdk-customerprofiles (1.10.0)
221
221
  aws-sdk-core (~> 3, >= 3.119.0)
222
222
  aws-sigv4 (~> 1.1)
223
223
  aws-sdk-databasemigrationservice (1.56.0)
@@ -286,7 +286,7 @@ GEM
286
286
  aws-sdk-eks (1.60.0)
287
287
  aws-sdk-core (~> 3, >= 3.119.0)
288
288
  aws-sigv4 (~> 1.1)
289
- aws-sdk-elasticache (1.59.0)
289
+ aws-sdk-elasticache (1.60.0)
290
290
  aws-sdk-core (~> 3, >= 3.119.0)
291
291
  aws-sigv4 (~> 1.1)
292
292
  aws-sdk-elasticbeanstalk (1.44.0)
@@ -307,7 +307,7 @@ GEM
307
307
  aws-sdk-elastictranscoder (1.31.0)
308
308
  aws-sdk-core (~> 3, >= 3.119.0)
309
309
  aws-sigv4 (~> 1.1)
310
- aws-sdk-emr (1.48.0)
310
+ aws-sdk-emr (1.49.0)
311
311
  aws-sdk-core (~> 3, >= 3.119.0)
312
312
  aws-sigv4 (~> 1.1)
313
313
  aws-sdk-emrcontainers (1.6.0)
@@ -355,7 +355,7 @@ GEM
355
355
  aws-sdk-glue (1.93.0)
356
356
  aws-sdk-core (~> 3, >= 3.119.0)
357
357
  aws-sigv4 (~> 1.1)
358
- aws-sdk-gluedatabrew (1.11.0)
358
+ aws-sdk-gluedatabrew (1.12.0)
359
359
  aws-sdk-core (~> 3, >= 3.119.0)
360
360
  aws-sigv4 (~> 1.1)
361
361
  aws-sdk-greengrass (1.42.0)
@@ -472,7 +472,7 @@ GEM
472
472
  aws-sdk-lakeformation (1.16.0)
473
473
  aws-sdk-core (~> 3, >= 3.119.0)
474
474
  aws-sigv4 (~> 1.1)
475
- aws-sdk-lambda (1.66.0)
475
+ aws-sdk-lambda (1.67.0)
476
476
  aws-sdk-core (~> 3, >= 3.119.0)
477
477
  aws-sigv4 (~> 1.1)
478
478
  aws-sdk-lambdapreview (1.28.0)
@@ -640,7 +640,7 @@ GEM
640
640
  aws-sdk-qldbsession (1.15.0)
641
641
  aws-sdk-core (~> 3, >= 3.119.0)
642
642
  aws-sigv4 (~> 1.1)
643
- aws-sdk-quicksight (1.50.0)
643
+ aws-sdk-quicksight (1.51.0)
644
644
  aws-sdk-core (~> 3, >= 3.119.0)
645
645
  aws-sigv4 (~> 1.1)
646
646
  aws-sdk-ram (1.28.0)
@@ -975,7 +975,7 @@ GEM
975
975
  aws-sdk-s3outposts (1.5.0)
976
976
  aws-sdk-core (~> 3, >= 3.119.0)
977
977
  aws-sigv4 (~> 1.1)
978
- aws-sdk-sagemaker (1.95.0)
978
+ aws-sdk-sagemaker (1.96.0)
979
979
  aws-sdk-core (~> 3, >= 3.119.0)
980
980
  aws-sigv4 (~> 1.1)
981
981
  aws-sdk-sagemakeredgemanager (1.4.0)
@@ -1146,6 +1146,7 @@ PLATFORMS
1146
1146
  x86_64-linux
1147
1147
 
1148
1148
  DEPENDENCIES
1149
+ aws-sdk
1149
1150
  aws-sdk-secretsmanager
1150
1151
  aws-sesocio-secrets!
1151
1152
  rake (~> 13.0)
@@ -17,19 +17,17 @@ module Aws
17
17
  yield self
18
18
  end
19
19
 
20
- def self.get_parameters
21
- response = JSON.parse(`aws ssm get-parameters --names '#{environment}-#{repo_name}'`)
22
- response["Parameters"].each do |parameter|
23
- JSON.parse(parameter["Value"]).each do |key, value|
24
- ENV[key] = value
25
- end
20
+ def self.get_parameters(repo)
21
+ response = JSON.parse(Aws::SSM::Client.new.get_parameter(name: "#{environment}-#{repo}").to_json)
22
+ response.each do |key, value|
23
+ ENV[key] = value
26
24
  end
27
25
  rescue
28
26
  "Permission problem: che the configuration before continue."
29
27
  end
30
28
 
31
- def self.get_secrets
32
- secret_name = "#{self.environment}-#{self.repo_name}-secret"
29
+ def self.get_secrets(repo)
30
+ secret_name = "#{self.environment}-#{repo}-secret"
33
31
  region_name = "us-east-1"
34
32
  client = Aws::SecretsManager::Client.new(region: region_name)
35
33
  begin
@@ -57,8 +55,10 @@ module Aws
57
55
  end
58
56
 
59
57
  def self.populate_env
60
- get_parameters
61
- get_secrets
58
+ self.repo_name.each do |repo|
59
+ get_parameters(repo)
60
+ get_secrets(repo)
61
+ end
62
62
  end
63
63
  end
64
64
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aws
4
4
  module Sesocio
5
- VERSION = "0.1.13"
5
+ VERSION = "0.1.17"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sesocio-secrets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facundo Díaz Martínez