lono 4.2.6 → 4.2.7
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/lono/cfn/base.rb +16 -7
- data/lib/lono/cfn/preview.rb +2 -1
- data/lib/lono/cfn/update.rb +1 -0
- data/lib/lono/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0cbcfa87ee5f1282166f6d878e37bf3f69b8f2facbad9774ed254d72d90f75e
|
4
|
+
data.tar.gz: f63bfd75b1892b6a7eacade99308cbf164afc026795d636daab59974ea0fe416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba2ad72fb843067693c95df59783e06a6e5943777fac3ed65ea96ca5d04a3f4ccb76e834cc5490e5edb7f2d967a3d0f7dbd9ae278d55f33f7b9678909e5487e3
|
7
|
+
data.tar.gz: 00b0fbeb10085941bdd18ad53f5c46f0e5f45c9f1d946bc3f1bd1822d30824e86b269ce4c92e8e8114384a2cbd13cd9e177740000f971d48c0ef40f17257f460
|
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
|
+
## [4.2.7]
|
7
|
+
- retain tag values on cfn update operations
|
8
|
+
|
6
9
|
## [4.2.6]
|
7
10
|
- #40 lono cfn create --tags a:1 b:2 option
|
8
11
|
|
data/lib/lono/cfn/base.rb
CHANGED
@@ -115,17 +115,26 @@ class Lono::Cfn::Base
|
|
115
115
|
generator.params # Returns Array in underscore keys format
|
116
116
|
end
|
117
117
|
|
118
|
+
# Maps to CloudFormation format. Example:
|
119
|
+
#
|
120
|
+
# {"a"=>"1", "b"=>"2"}
|
121
|
+
# To
|
122
|
+
# [{key: "a", value: "1"}, {key: "b", value: "2"}]
|
123
|
+
#
|
118
124
|
def tags
|
119
|
-
# Map to CloudFormation format. Example:
|
120
|
-
#
|
121
|
-
# {"a"=>"1", "b"=>"2"}
|
122
|
-
# To
|
123
|
-
# [{key: "a", value: "1"}, {key: "b", value: "2"}]
|
124
|
-
#
|
125
125
|
tags = @options[:tags] || []
|
126
|
-
tags.map do |k,v|
|
126
|
+
tags = tags.map do |k,v|
|
127
127
|
{ key: k, value: v }
|
128
128
|
end
|
129
|
+
|
130
|
+
update_operation = %w[Lono::Cfn::Preview Lono::Cfn::Update].include?(self.class.to_s)
|
131
|
+
if tags.empty? && update_operation
|
132
|
+
resp = cfn.describe_stacks(stack_name: @stack_name)
|
133
|
+
tags = resp.stacks.first.tags
|
134
|
+
tags = tags.map(&:to_h)
|
135
|
+
end
|
136
|
+
|
137
|
+
tags
|
129
138
|
end
|
130
139
|
|
131
140
|
def check_for_errors
|
data/lib/lono/cfn/preview.rb
CHANGED
@@ -26,7 +26,8 @@ class Lono::Cfn::Preview < Lono::Cfn::Base
|
|
26
26
|
change_set_name: change_set_name,
|
27
27
|
stack_name: @stack_name,
|
28
28
|
parameters: params,
|
29
|
-
capabilities: capabilities, # ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"]
|
29
|
+
capabilities: capabilities, # ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"],
|
30
|
+
tags: tags,
|
30
31
|
}
|
31
32
|
set_template_body!(params)
|
32
33
|
show_parameters(params, "cfn.create_change_set")
|
data/lib/lono/cfn/update.rb
CHANGED
@@ -42,6 +42,7 @@ class Lono::Cfn::Update < Lono::Cfn::Base
|
|
42
42
|
parameters: params,
|
43
43
|
capabilities: capabilities, # ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM"]
|
44
44
|
disable_rollback: !@options[:rollback],
|
45
|
+
tags: tags,
|
45
46
|
}
|
46
47
|
set_template_body!(params)
|
47
48
|
show_parameters(params, "cfn.update_stack")
|
data/lib/lono/version.rb
CHANGED