smps 0.1.3 → 0.2.0

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
  SHA1:
3
- metadata.gz: d0e0b58ea22b54b674c067affff5cca058452e4e
4
- data.tar.gz: 6bbb089f692f478ae990f1a929e9ffb1383d3f63
3
+ metadata.gz: 2592793a373af3a1f29aba3417884fe1e6a1b1c4
4
+ data.tar.gz: eca608af712b806e0f81836328df50df290e6f47
5
5
  SHA512:
6
- metadata.gz: 9613bb26f166243ac781a042d5c0c11adf9f89ff160d93bf92ca40f0ff5a3700837da8846a8b9cb56f27d41bcd4a25b2644d5c4ab64d1e4eb06ff113341397a2
7
- data.tar.gz: 1effe41ec86f4dc2a1f203e46c55c12d8f19ac07e358c24a0e1cf2887a2fa85a0e2f2aa5fbb1f01c6fd4094ef0fb31ba4c227f63dd3bb283e44f87e76f7f1f67
6
+ metadata.gz: a94e15e1860a5c3c6e995660e8bfb3e7c9c092a59de6cbc022d4acc0025425644d9737469047ddec9ecab70431c02bbbf3ee94fac92757cf1a5584a3e428cfc0
7
+ data.tar.gz: 17e3de415445ddf7b703b1f7bf31ac98d84ba510b26154e3b58c47e50e021b8b0b0b5aaa62fe2eb30ba6ba25871e6a8076297800139448d84ffd8361c156e16b
data/changelog.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## [Unreleased]
5
+
6
+ ## [0.2.0] - 2017-10-05
7
+ ### Added
8
+ - smps cli query script
9
+
10
+ ### Changed
11
+ - ...
12
+
13
+ ### Removed
14
+ - ...
15
+
16
+ ## [0.1.3] - 2017-10-05
17
+ ### Added
18
+ - ...
19
+
20
+ ### Changed
21
+ - ...
22
+
23
+ ### Removed
24
+ - ...
data/exe/smps ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env ruby
2
+ require 'getoptlong'
3
+ require 'smps'
4
+
5
+ def clidoc
6
+ puts <<-CLIDOC
7
+
8
+ #{$PROGRAM_NAME} [OPTION]
9
+
10
+ -h, --help:
11
+ show help
12
+
13
+ -r, --role <rolename>
14
+ IAM role to use. From ~/.aws/config
15
+
16
+ -p, --param <param_name>
17
+ Parameter name.
18
+
19
+ -d, --debug [level]:
20
+ Debug level.
21
+
22
+ CLIDOC
23
+ end
24
+
25
+ opts = GetoptLong.new(
26
+ ['--help', '-h', GetoptLong::NO_ARGUMENT],
27
+ ['--role', '-r', GetoptLong::REQUIRED_ARGUMENT],
28
+ ['--param', '-p', GetoptLong::REQUIRED_ARGUMENT],
29
+ ['--debug', '-d', GetoptLong::OPTIONAL_ARGUMENT]
30
+ )
31
+
32
+ role = nil
33
+ param = nil
34
+ debug = 0
35
+
36
+ opts.each do |opt, arg|
37
+ case opt
38
+ when '--help'
39
+ clidoc
40
+ exit
41
+ when '--role'
42
+ role = arg
43
+ when '--param'
44
+ param = arg
45
+ when '--debug'
46
+ debug = if arg == ''
47
+ 1
48
+ else
49
+ arg.to_i
50
+ end
51
+ end
52
+ end
53
+
54
+ require 'awssession'
55
+ require 'aws_config'
56
+
57
+ if role
58
+ profile_name = role
59
+ profile = AWSConfig[profile_name]
60
+ profile['name'] = profile_name
61
+
62
+ awssession = AwsSession.new(profile: profile, debug: debug)
63
+ awssession.start
64
+
65
+ smps = SmPs.new(credentials: awssession.credentials)
66
+ else
67
+ smps = SmPs.new
68
+ end
69
+
70
+ puts smps.parameter(param).to_s
71
+
72
+ # vim:set fileencoding=utf8 fileformat=unix filetype=ruby tabstop=2 expandtab:
data/lib/smps/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class SmPs
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
data/lib/smps.rb CHANGED
@@ -2,6 +2,7 @@ require 'smps/version'
2
2
  require 'smps/parameter'
3
3
  require 'aws-sdk-ssm'
4
4
 
5
+ # SmPs class queries and writes Paramstore parameters
5
6
  class SmPs
6
7
  def initialize(options = {})
7
8
  @credentials = options[:credentials]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan - Zipkid - Goethals
@@ -111,7 +111,8 @@ dependencies:
111
111
  description: SMPS - Systems Manager Parameter Store
112
112
  email:
113
113
  - stefan.goethals@vrt.be
114
- executables: []
114
+ executables:
115
+ - smps
115
116
  extensions: []
116
117
  extra_rdoc_files: []
117
118
  files:
@@ -125,6 +126,8 @@ files:
125
126
  - bin/setup
126
127
  - bin/smps-use-ec2.rb
127
128
  - bin/smps-use.rb
129
+ - changelog.md
130
+ - exe/smps
128
131
  - lib/smps.rb
129
132
  - lib/smps/parameter.rb
130
133
  - lib/smps/version.rb