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 +4 -4
- data/lib/paramsync/config.rb +10 -8
- data/lib/paramsync/sync_target.rb +5 -5
- data/lib/paramsync/version.rb +1 -1
- data/paramsync.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1737f5309e5c962349a0e7f2d88b82c81efde728423fc0949b6cf3ee6fb3630d
|
4
|
+
data.tar.gz: 17343e6a1e4cf247f9cc7ed62cbcd505475b5ad0139101ea123ed4bcb3ac68c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41340555115ccaf87bfc1fbf86cde749c08bbd9b7278a3409204c8762cc7402c196f319c8ff3d391ef7ff0b1ae9b079eb15e3e978fefa87724764826dfc76f86
|
7
|
+
data.tar.gz: 4a30fd3fa450465c0c8b2ca435ce5fc94d767b1cd64ab09a7661604d13138d922350ffce78de4d4754d382d00e6590d40b5146f00623c2011e7b0e71bc857841
|
data/lib/paramsync/config.rb
CHANGED
@@ -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
|
-
|
155
|
-
|
156
|
-
|
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
|
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
|
|
data/lib/paramsync/version.rb
CHANGED
data/paramsync.gemspec
CHANGED
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.
|
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:
|
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.
|
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
|