lono 5.3.0 → 5.3.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: 805088c405e44e3e7b228f5d03a893af2a99c2ce990615bb89b906c0c2bb56ee
4
- data.tar.gz: fff83f7bdae3c28fed272a489e3170d09f803d35a05e943b98db33c89e5d7a9e
3
+ metadata.gz: ab8f59278665a11fa19fb70dfbb8959271156d79cede05f67acd56ef12b7b8c5
4
+ data.tar.gz: 640cc60f99dc42503b7f583384fc2700ea12ce720cf76f1e6203ef05ba753e88
5
5
  SHA512:
6
- metadata.gz: bd70ed81d8e4495dff371cd2ec66b519b1002325dac0d17d094a31127ea4e9d186a00001200391f36b9dcece8f85b25f085abeb09c49eedc1f269be457113ad0
7
- data.tar.gz: 9bb60f3efa20a1c06a0597656f0729e1723380c2af6b20f673f28f4b08fe2ac941876e3252f405864bd488b989b5d7436ce3dad50b65bb059bf51371751b0290
6
+ metadata.gz: 27cf1a8a766adf340f9c57c68b4d0870037c53bd281c4fe444923a4df5727dc994773b98f2ded35982a432eaf8a70b6072a84dbd61ea529f86c5b6ad8b06062e
7
+ data.tar.gz: 944c85c1bb31cc3e1fd0682934aeb4302d85b1c832b0450ca3211901e00173f53d268f5746a3abd4324d86ebee0b81dd698cfbe4e02e94b6def8d0b027787575
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [5.3.1]
7
+ - #10 fixes for param diff preview: Ignore noecho parameters
8
+
6
9
  ## [5.3.0]
7
10
  - #8 param preview feature. 3rd type of preview.
8
11
  - #9 ssm helper support in configs
@@ -15,28 +15,38 @@ module Lono::Cfn::Preview
15
15
  return
16
16
  end
17
17
 
18
- params = generate_all
19
- write_to_tmp(new_path, params)
20
18
  write_to_tmp(existing_path, existing_parameters)
19
+ write_to_tmp(new_path, new_parameters)
21
20
 
22
21
  show_diff(existing_path, new_path)
23
22
  end
24
23
 
24
+ def new_parameters
25
+ params = generate_all
26
+ params.reject { |p| ignore_parameters.include?(p[:parameter_key]) }
27
+ end
28
+
25
29
  def existing_parameters
26
- resp = cfn.describe_stacks(stack_name: @stack_name)
27
- stack = resp.stacks.first
28
- parameters = stack.parameters
30
+ existing = stack_parameters
31
+ existing = existing.reject { |p| ignore_parameters.include?(p.parameter_key) }
32
+ convert_to_cfn_format(existing)
33
+ end
29
34
 
35
+ def ignore_parameters
30
36
  # Remove optional parameters if they match already. Produces better diff.
31
- optional = optional_parameters.map do |logical_id, attributes|
32
- {
33
- "ParameterKey" => logical_id,
34
- "ParameterValue" => attributes["Default"],
35
- }
36
- end
37
- converted = convert_to_cfn_format(parameters)
38
- converted - optional
37
+ optional = optional_parameters.map { |logical_id, attributes| logical_id }
38
+ noecho = stack_parameters.select { |p| p.parameter_value == '****' }
39
+ noecho = noecho.map { |p| p.parameter_key }
40
+ optional + noecho
41
+ end
42
+ memoize :ignore_parameters
43
+
44
+ def stack_parameters
45
+ resp = cfn.describe_stacks(stack_name: @stack_name)
46
+ stack = resp.stacks.first
47
+ stack.parameters
39
48
  end
49
+ memoize :stack_parameters
40
50
 
41
51
  private
42
52
  def output_template
@@ -20,11 +20,11 @@ module Lono
20
20
  end
21
21
 
22
22
  def required_parameters
23
- parameters.reject { |logical_id, p| p["Default"] }
23
+ parameters.reject { |logical_id, p| p["Default"].nil? }
24
24
  end
25
25
 
26
26
  def optional_parameters
27
- parameters.select { |logical_id, p| p["Default"] }
27
+ parameters.select { |logical_id, p| !p["Default"].nil? }
28
28
  end
29
29
 
30
30
  def parameters
data/lib/lono/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "5.3.0"
2
+ VERSION = "5.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-23 00:00:00.000000000 Z
11
+ date: 2019-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport