lono 4.2.6 → 4.2.7

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: 91c4368a7041abb9f6fe3d5e7b0eac3f6eae829b1a6945b920e3c1218fc82d9f
4
- data.tar.gz: 99a9dd76894952b54df9f3a96694506edf1865c8b24c89c8480cf1e0deb483c9
3
+ metadata.gz: d0cbcfa87ee5f1282166f6d878e37bf3f69b8f2facbad9774ed254d72d90f75e
4
+ data.tar.gz: f63bfd75b1892b6a7eacade99308cbf164afc026795d636daab59974ea0fe416
5
5
  SHA512:
6
- metadata.gz: 1e1635d50b6caee0619be6adeb60b0d3705d764de85b5f274d17b7ea8b4693b9faac40141f396d5fd1b4956119e364270c340c152a4b67c20e85b8818b9ee4c7
7
- data.tar.gz: 56f9cc31183531d339fdb4c5769e4b968404202174d1f323197ea3e548379c6542569e1edfb463b7c597aa3de8e46434e66abe60a66bc6dd3a62c40f104efe2f
6
+ metadata.gz: ba2ad72fb843067693c95df59783e06a6e5943777fac3ed65ea96ca5d04a3f4ccb76e834cc5490e5edb7f2d967a3d0f7dbd9ae278d55f33f7b9678909e5487e3
7
+ data.tar.gz: 00b0fbeb10085941bdd18ad53f5c46f0e5f45c9f1d946bc3f1bd1822d30824e86b269ce4c92e8e8114384a2cbd13cd9e177740000f971d48c0ef40f17257f460
@@ -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
 
@@ -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
@@ -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")
@@ -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")
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "4.2.6"
2
+ VERSION = "4.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.6
4
+ version: 4.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen