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.
- checksums.yaml +4 -4
- data/lib/vaporware.rb +16 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30ed66b85dd7d46a834d0a6a4f7765490c881863
|
|
4
|
+
data.tar.gz: dfe7f25f1397546009b6fec03a972f96e3c0596b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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:
|
|
77
|
+
on_failure: @on_failure,
|
|
78
|
+
tags: @tags
|
|
65
79
|
}
|
|
66
80
|
end
|
|
67
81
|
|