terraform-exporter 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 268df7a7c3734ec6b3262aaad17fd35992ab3da5
4
- data.tar.gz: ff73e11a723b3572828093a152b759d7e6e2c23e
3
+ metadata.gz: da876c668fbec0fa10d3d2e3b0db23df056343f5
4
+ data.tar.gz: ce7438ba8daea062a08e02ea1d15fc252740193c
5
5
  SHA512:
6
- metadata.gz: c62a4264e70ea0b3bf45c930e9f913be5ee9372355233995d5f511d4cd232881eb17b481a298a12fc28256fa860894df2a1b836362243fdd9353a4540ac7736f
7
- data.tar.gz: d99388881840946c339f82633821155571a4bb1b291ce6294d87f943a1da94818d788990884c3554b6a8d16748798ec3c7141ff63300db09c359a4cd97d911cb
6
+ metadata.gz: 9db7298c3bd1ec0d68931db50a5d984148fc2f15254d898509c3bc3d1558c585d9d8437765ea5f698cfe3a23d406c055f202a30cf3fd7e215118cf63038c3c97
7
+ data.tar.gz: 673c4fcbc0c5a28437af0cd56d363111458b3506289e2e44525b1579fbaa4d6bcecd678fb49c5b2cc93066bcb12a75602a9aba1c5583ba226b2cad0f60445f10
@@ -76,7 +76,7 @@ module Terraformer
76
76
  "name" => monitor["name"],
77
77
  "type" => monitor["type"],
78
78
  "message" => monitor["message"],
79
- "escalation_message" => monitor["escalation_message"],
79
+ "escalation_message" => monitor["options"]["escalation_message"],
80
80
  "query" => monitor["query"],
81
81
  "notify_no_data" => monitor["options"]["notify_no_data"],
82
82
  "no_data_timeframe" => monitor["options"]["no_data_timeframe"],
@@ -94,7 +94,7 @@ module Terraformer
94
94
  option.each { |k, v| attributes["#{argument}.#{k}"] = v }
95
95
  end
96
96
  attributes["tags.%"] = monitor["tags"].length
97
- monitor["tags"].each { |tag| attributes["tags.#{tag.split(":")[0]}"] = tag.split(":")[0] }
97
+ monitor["tags"].each { |tag| attributes["tags.#{tag.split(":")[0]}"] = tag.split(":")[1] }
98
98
 
99
99
  sanitize_monitor(attributes)
100
100
  end
@@ -12,6 +12,9 @@ resource "aws_cloudwatch_metric_alarm" "<%= alarm.normalized_name %>" {
12
12
  <%- unless alarm.ok_actions.empty? -%>
13
13
  ok_actions = <%= alarm.ok_actions %>
14
14
  <%- end -%>
15
+ <%- unless alarm.unit.nil? || alarm.unit == "" -%>
16
+ unit = "<%= alarm.unit %>"
17
+ <%- end -%>
15
18
  <%- unless alarm.alarm_actions.empty? -%>
16
19
  alarm_actions = <%= alarm.alarm_actions %>
17
20
  <%- end -%>
@@ -10,8 +10,14 @@ EOF
10
10
  <%- else -%>
11
11
  message = "<%= monitor["message"] %>"
12
12
  <%- end -%>
13
- <%- unless monitor["escalation_message"].nil? -%>
14
- escalation_message = <%= monitor["escalation_message"] %>
13
+ <%- unless monitor["options"]["escalation_message"].nil? -%>
14
+ <%- if monitor["options"]["escalation_message"].include? "\n" -%>
15
+ escalation_message = <<EOF
16
+ <%= monitor["options"]["escalation_message"] %>
17
+ EOF
18
+ <%- else -%>
19
+ escalation_message = "<%= monitor["options"]["escalation_message"] %>"
20
+ <%- end -%>
15
21
  <%- end -%>
16
22
 
17
23
  thresholds {
@@ -27,8 +33,8 @@ EOF
27
33
  <%- unless monitor["options"]["notify_no_data"].nil? -%>
28
34
  notify_no_data = <%= monitor["options"]["notify_no_data"] %>
29
35
  <%- end -%>
30
- <%- unless monitor["options"]["no_data_timeframe "].nil? -%>
31
- no_data_timeframe = <%= monitor["options"]["no_data_timeframe "] %>
36
+ <%- unless monitor["options"]["no_data_timeframe"].nil? -%>
37
+ no_data_timeframe = <%= monitor["options"]["no_data_timeframe"] %>
32
38
  <%- end -%>
33
39
  <%- unless monitor["options"]["renotify_interval"].nil? -%>
34
40
  renotify_interval = <%= monitor["options"]["renotify_interval"] %>
@@ -52,15 +58,15 @@ EOF
52
58
 
53
59
  silenced {
54
60
  <% monitor["options"]["silenced"].each do |key, value| -%>
55
- "<%= key %>" = "<%= value || 0 %>"
61
+ "<%= key %>" = "<%= value || 0 %>"
56
62
  <%- end -%>
57
63
  }
58
64
  <%- end -%>
59
- <%- unless monitor["options"]["tags"].nil? || monitor["options"]["tags"].empty? -%>
65
+ <%- unless monitor["tags"].nil? || monitor["tags"].empty? -%>
60
66
 
61
67
  tags {
62
- <% monitor["options"]["tags"].each do |tag| -%>
63
- "<%= tag.split(":")[0] %>" = "<%= tag.split(":")[1] %>"
68
+ <% monitor["tags"].each do |tag| -%>
69
+ "<%= tag.split(":")[0] %>" = "<%= tag.split(":")[1] %>"
64
70
  <%- end -%>
65
71
  }
66
72
  <%- end -%>
@@ -1,3 +1,3 @@
1
1
  module Terraformer
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraform-exporter
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
  - Jacopo Scrinzi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-09 00:00:00.000000000 Z
11
+ date: 2016-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk