paramsync 0.1.0 → 0.1.1

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: 37d39c92a6c66de87ac34ede59db549949cd7385035fb6459024c0feb3a5efb4
4
- data.tar.gz: d6f3655096d15d5843bf4606835f27f6675c2ecd6237643deafa93d1ac3e9d08
3
+ metadata.gz: 1737f5309e5c962349a0e7f2d88b82c81efde728423fc0949b6cf3ee6fb3630d
4
+ data.tar.gz: 17343e6a1e4cf247f9cc7ed62cbcd505475b5ad0139101ea123ed4bcb3ac68c1
5
5
  SHA512:
6
- metadata.gz: 5d2e34c7ee05e6985348214c92ecc5b05eb7fb966b0b95288f1237e45ed7126e24a3d9337c260f0d409501efd40e4d5f264747aca4f6fb8a5040e3416ee157ec
7
- data.tar.gz: 53399f07cfe95f581835517af20cf517e8c89673ca20f90cf2951622172fb00c5a5ebc2e1bdfe8bf2b65a5c4642d14de91fdcc91bc0ee1436a9ca03183b3deb7
6
+ metadata.gz: 41340555115ccaf87bfc1fbf86cde749c08bbd9b7278a3409204c8762cc7402c196f319c8ff3d391ef7ff0b1ae9b079eb15e3e978fefa87724764826dfc76f86
7
+ data.tar.gz: 4a30fd3fa450465c0c8b2ca435ce5fc94d767b1cd64ab09a7661604d13138d922350ffce78de4d4754d382d00e6590d40b5146f00623c2011e7b0e71bc857841
@@ -131,14 +131,14 @@ class Paramsync
131
131
  end
132
132
 
133
133
  if raw['ssm'].has_key?('kms')
134
- self.kms_client = Aws::KMS::Client.new(
134
+ self.kms_client = Aws::KMS::Client.new(**{
135
135
  region: raw['ssm']['kms']['region'],
136
- credentials: Aws::AssumeRoleCredentials.new(
136
+ credentials: raw['ssm']['kms']['role'] ? Aws::AssumeRoleCredentials.new(
137
137
  client: Aws::STS::Client.new(region: raw['ssm']['kms']['region']),
138
138
  role_arn: raw['ssm']['kms']['role'],
139
139
  role_session_name: "paramsync"
140
- ),
141
- )
140
+ ) : nil,
141
+ }.compact)
142
142
  self.kms_key = raw['ssm']['kms']['arn']
143
143
  end
144
144
 
@@ -151,9 +151,11 @@ class Paramsync
151
151
  if target['delete'].nil?
152
152
  target['delete'] = self.delete?
153
153
  end
154
- account = self.ssm_accounts[target['account']]
155
- if account.nil?
156
- raise Paramsync::ConfigFileInvalid.new("Account '#{target['account']}' is not defined")
154
+ if target['account']
155
+ account = self.ssm_accounts[target['account']]
156
+ if account.nil?
157
+ raise Paramsync::ConfigFileInvalid.new("Account '#{target['account']}' is not defined")
158
+ end
157
159
  end
158
160
  end
159
161
 
@@ -165,7 +167,7 @@ class Paramsync
165
167
  next if not self.target_allowlist.include?(target['name'])
166
168
  end
167
169
 
168
- self.sync_targets << Paramsync::SyncTarget.new(config: target, account: account['role'], base_dir: self.base_dir)
170
+ self.sync_targets << Paramsync::SyncTarget.new(config: target, account: account ? account['role'] : nil, base_dir: self.base_dir)
169
171
  end
170
172
  end
171
173
  end
@@ -5,7 +5,7 @@ class Paramsync
5
5
  VALID_CONFIG_KEYS = %w( name type region prefix path exclude chomp delete erb_enabled account )
6
6
  attr_accessor :name, :type, :region, :prefix, :path, :exclude, :erb_enabled, :account, :ssm
7
7
 
8
- REQUIRED_CONFIG_KEYS = %w( prefix region account )
8
+ REQUIRED_CONFIG_KEYS = %w( prefix region )
9
9
  VALID_TYPES = [ :dir, :file ]
10
10
  DEFAULT_TYPE = :dir
11
11
 
@@ -47,14 +47,14 @@ class Paramsync
47
47
  @do_delete = false
48
48
  end
49
49
 
50
- self.ssm = Aws::SSM::Client.new(
50
+ self.ssm = Aws::SSM::Client.new(**{
51
51
  region: region,
52
- credentials: Aws::AssumeRoleCredentials.new(
52
+ credentials: account ? Aws::AssumeRoleCredentials.new(
53
53
  client: Aws::STS::Client.new(region: region),
54
54
  role_arn: account,
55
55
  role_session_name: "paramsync"
56
- ),
57
- )
56
+ ) : nil,
57
+ }.compact)
58
58
  self.erb_enabled = config['erb_enabled']
59
59
  end
60
60
 
@@ -1,5 +1,5 @@
1
1
  # This software is public domain. No rights are reserved. See LICENSE for more information.
2
2
 
3
3
  class Paramsync
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/paramsync.gemspec CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
 
27
27
  s.add_dependency 'aws-sdk-ssm', '~> 1.89.0'
28
28
  s.add_dependency 'aws-sdk-kms', '~> 1.37.0'
29
+ s.add_dependency 'diffy', '~> 3.2'
29
30
 
30
31
  s.add_development_dependency 'rspec', '~> 3.0'
31
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paramsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Adams
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-02-22 00:00:00.000000000 Z
12
+ date: 2022-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-ssm
@@ -39,6 +39,20 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: 1.37.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: diffy
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.2'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.2'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: rspec
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -96,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
110
  - !ruby/object:Gem::Version
97
111
  version: '0'
98
112
  requirements: []
99
- rubygems_version: 3.1.4
113
+ rubygems_version: 3.1.6
100
114
  signing_key:
101
115
  specification_version: 4
102
116
  summary: Simple filesystem-to-aws parameter store synchronization