vaporware 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vaporware.rb +16 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 721ea262349f65a49927d56873311fe2795d59de
4
- data.tar.gz: 9347d188962d08be1d92985b894ce120b157636b
3
+ metadata.gz: 30ed66b85dd7d46a834d0a6a4f7765490c881863
4
+ data.tar.gz: dfe7f25f1397546009b6fec03a972f96e3c0596b
5
5
  SHA512:
6
- metadata.gz: 5099980aee34ea053350209c780c731f52dc8560accd7e5f206679eccb5250f508c8cf0448f8d10c71b32c2c2e6d57cada33dea6b584c6031e2f197e4ed30b5e
7
- data.tar.gz: cc55c357c81aa2fae17a76f09c52836327eee086be6211e81f33ea7d2f71a99994526cff766fd20d0424712e743a2bff0ea7d4d4867a8cd3bc0c006fa9170944
6
+ metadata.gz: 47e06a33320cd50a7f8edb8a788364ec501aeb044954f83b57b774a4b1ca88c9b73a886eb5e97496e0b0a80d8214e2c9f3727b496d105db2e93448daf0bed9ad
7
+ data.tar.gz: c7cb64b0bd85e69e5492e13b0de0a12a4dd9c6f45ae3a62d5c98cd6a470787159804e9f8276e1d8071d6e0d0a694908f55e8f7f3a1091bcfbd714f444c855cd3
data/lib/vaporware.rb CHANGED
@@ -7,7 +7,9 @@ class Vaporware
7
7
  options = {
8
8
  stack_name: "change-me",
9
9
  parameters: {},
10
- timeout: 40 # minutes
10
+ timeout: 40, # minutes
11
+ tags: {},
12
+ on_failure: "ROLLBACK" # or: DO_NOTHING, DELETE
11
13
  }.merge opts
12
14
  fail "You must specify a template filename!" unless options[:template_filename]
13
15
 
@@ -16,6 +18,8 @@ class Vaporware
16
18
  @template_body = File.read(options[:template_filename])
17
19
  @parameters = build_parameters options[:parameters]
18
20
  @timeout = options[:timeout]
21
+ @tags = build_tags options[:tags]
22
+ @on_failure = options[:on_failure]
19
23
  end
20
24
 
21
25
  def apply
@@ -54,6 +58,15 @@ class Vaporware
54
58
  end
55
59
  end
56
60
 
61
+ def build_tags tags
62
+ tags.keys.reduce([]) do |acc, key|
63
+ acc << {
64
+ key: key.to_s,
65
+ value: tags[key]
66
+ }
67
+ end
68
+ end
69
+
57
70
  def stack_params
58
71
  {
59
72
  stack_name: @stack_name,
@@ -61,7 +74,8 @@ class Vaporware
61
74
  parameters: @parameters,
62
75
  timeout_in_minutes: @timeout,
63
76
  capabilities: ["CAPABILITY_IAM"],
64
- on_failure: "ROLLBACK"
77
+ on_failure: @on_failure,
78
+ tags: @tags
65
79
  }
66
80
  end
67
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vaporware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Audrey Schwarz