awshark 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1893ca9f5ab0defd36515f70c621d987d2981c01b8c70bab0735ff422ec7c588
4
- data.tar.gz: dd4c8992a1c8c5aec6e978f60e5d8f879f46e4013fe1fe5ea45e274d426f3b81
3
+ metadata.gz: dbb6b1c8acc6985b27bae79aceffe7e15898e37a975cdef6eac0678ab3d644f2
4
+ data.tar.gz: 141dde43ded62f04ac26d2fea21f38b5b829a6d755ea42c0d0aa0ccfaeb2d316
5
5
  SHA512:
6
- metadata.gz: 31f09cd910a4b782c4ba1e142d89446fb92259eafbb51cbbdbbc2d0108aa9bce50bd24c9dd5f01740bc5f5ec560fc7703554df347b7b4279bce8a6a38c2ce666
7
- data.tar.gz: fd69d7cd781331e6a25d2d1c5615b66bfae57796a8f16bd441888a348951a3e9cb157b5def2df3f4214517c7b5f71b85b2affcb76af78771b995843fbe360236
6
+ metadata.gz: 8307e5b068979c55a48f7b87b8aab75b32b8b5f0e4e2c4e42fce39b57b78c6dea08441ebcaaca30a8615b2bf56875ca10fe514da61d574f6e71cec52338d9327
7
+ data.tar.gz: f8372c0258917758924fadd5aab3f074b17b7dc1ffb2c124af5aba1146dcc560845090d366ce780cfb1f1e4fb6aad4574db0d345a8ed29fb9a6be74a03fd22e8
data/.rubocop.yml CHANGED
@@ -12,7 +12,6 @@ AllCops:
12
12
  - 'spec/**/*'
13
13
  - 'tmp/*'
14
14
 
15
-
16
15
  Layout/BeginEndAlignment:
17
16
  Enabled: true
18
17
  EnforcedStyleAlignWith: begin
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  ## Changelog
2
2
 
3
+ #### 1.1.0
4
+ - ssm support added `<%= ssm["/#{stage}/app/application/db_host"] %>`
5
+
3
6
  #### 1.0.0
4
7
  - initial version
data/README.md CHANGED
@@ -53,8 +53,8 @@ You can also run `bin/console` for an interactive prompt that will allow you to
53
53
  To install this gem onto your local machine, run
54
54
 
55
55
  gem build awshark.gemspec
56
- gem install --local awshark-0.1.0.gem
57
- rm awshark-0.1.0.gem
56
+ gem install --local awshark-1.1.0.gem
57
+ rm awshark-1.1.0.gem
58
58
 
59
59
 
60
60
  ### Contributing
data/awshark.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.name = 'awshark'
9
9
  spec.version = Awshark::VERSION
10
10
  spec.authors = ['Joergen Dahlke']
11
- spec.email = ['joergen.dahlke@infopark.de']
11
+ spec.email = ['joergen.dahlke@gmail.com']
12
12
 
13
13
  spec.summary = 'Custom CLI for for AWS related tasks'
14
14
  spec.description = 'Custom CLI for for AWS to simplify common tasks with EC2, S3 and Cloud Formation'
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency 'aws-sdk-ecr'
37
37
  spec.add_dependency 'aws-sdk-rds'
38
38
  spec.add_dependency 'aws-sdk-s3'
39
+ spec.add_dependency 'aws-sdk-ssm', '~> 1.117.0'
39
40
  spec.add_dependency 'diffy'
40
41
  spec.add_dependency 'mini_mime'
41
42
  spec.add_dependency 'recursive-open-struct'
@@ -28,16 +28,18 @@ module Awshark
28
28
 
29
29
  # @returns [Hash]
30
30
  def context
31
- @context ||= begin
32
- context = load_file(context_path) || {}
33
- context = context[stage] if context.key?(stage)
34
-
35
- {
36
- context: RecursiveOpenStruct.new(context),
37
- aws_account_id: Awshark.config.aws_account_id,
38
- stage: stage
39
- }
40
- end
31
+ @context ||=
32
+ begin
33
+ context = load_file(context_path) || {}
34
+ context = context[stage] if context.key?(stage)
35
+
36
+ {
37
+ context: RecursiveOpenStruct.new(context),
38
+ aws_account_id: Awshark.config.aws_account_id,
39
+ stage: stage,
40
+ ssm: ssm
41
+ }
42
+ end
41
43
  end
42
44
 
43
45
  # @returns [Integer]
@@ -59,6 +61,13 @@ module Awshark
59
61
 
60
62
  private
61
63
 
64
+ def ssm
65
+ proc do |key|
66
+ @ssm_client ||= Aws::SSM::Client.new
67
+ @ssm_client.get_parameter(name: key, with_decryption: true)&.parameter&.value
68
+ end
69
+ end
70
+
62
71
  def region
63
72
  Aws.config[:region] || 'eu-central-1'
64
73
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'aws-sdk-cloudformation'
4
+ require 'aws-sdk-ssm'
4
5
  require 'diffy'
5
6
  require 'recursive-open-struct'
6
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Awshark
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awshark
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joergen Dahlke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-09 00:00:00.000000000 Z
11
+ date: 2021-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: aws-sdk-ssm
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.117.0
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 1.117.0
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: diffy
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -209,7 +223,7 @@ dependencies:
209
223
  description: Custom CLI for for AWS to simplify common tasks with EC2, S3 and Cloud
210
224
  Formation
211
225
  email:
212
- - joergen.dahlke@infopark.de
226
+ - joergen.dahlke@gmail.com
213
227
  executables:
214
228
  - awshark
215
229
  extensions: []