Skip to content

Commit 7ed0392

Browse files
Cameron SumpterSam Hewitt
Cameron Sumpter
authored and
Sam Hewitt
committed
Update cloudwatch alarm spec (#189)
Properties have been expanded since last update: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html
1 parent 37b7de8 commit 7ed0392

File tree

1 file changed

+44
-7
lines changed

1 file changed

+44
-7
lines changed

src/crucible/aws/cloudwatch.clj

+44-7
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,22 @@
2020
(s/def ::comparison-operator (spec-or-ref #{"GreaterThanOrEqualToThreshold"
2121
"GreaterThanThreshold"
2222
"LessThanThreshold"
23-
"LessThanOrEqualToThreshold"}))
23+
"LessThanOrEqualToThreshold"
24+
"LessThanLowerThreshold"
25+
"LessThanLowerOrGreaterThanUpperThreshold"}))
2426

2527
(s/def ::value (spec-or-ref string?))
2628

2729
(s/def ::name (spec-or-ref string?))
2830

31+
(s/def ::datapoints-to-alarm (spec-or-ref int?))
32+
2933
(s/def ::dimension (s/keys :req [::name ::value]))
3034

3135
(s/def ::dimensions (s/coll-of ::dimension :kind vector?))
3236

37+
(s/def ::evaluate-low-sample-count-percentile (spec-or-ref string?))
38+
3339
(s/def ::evaluation-periods (spec-or-ref pos-int?))
3440

3541
;; The percentile statistic for the metric. Specify a value between p0.0 and p100.
@@ -40,6 +46,31 @@
4046

4147
(s/def ::metric-name (spec-or-ref string?))
4248

49+
(s/def ::expression (spec-or-ref string?))
50+
51+
(s/def ::id (spec-or-ref string?))
52+
53+
(s/def ::label (spec-or-ref string?))
54+
55+
(s/def ::metric (s/keys :opt [::dimensions
56+
::metric-name
57+
::namespace]))
58+
59+
(s/def ::metric-stat (s/keys :req [::metric
60+
::period
61+
::stat]
62+
:opt [::unit]))
63+
64+
(s/def ::return-data (spec-or-ref boolean?))
65+
66+
(s/def ::metric-data-query (s/keys :req [::id]
67+
:opt [::expression
68+
::label
69+
::metric-stat
70+
::return-data]))
71+
72+
(s/def ::metrics (s/coll-of ::metric-data-query))
73+
4374
(s/def ::namespace (spec-or-ref string?))
4475

4576
(s/def ::ok-actions ::actions)
@@ -57,6 +88,8 @@
5788

5889
(s/def ::threshold (spec-or-ref double?))
5990

91+
(s/def ::threshold-metric-id (spec-or-ref string?))
92+
6093
(s/def ::treat-missing-data (spec-or-ref #{"breaching"
6194
"notBreaching"
6295
"ignore"
@@ -90,19 +123,23 @@
90123
"None"}))
91124

92125
(s/def ::alarm (s/keys :req [::comparison-operator
93-
::evaluation-periods
126+
::evaluation-periods]
127+
:opt [::namespace
94128
::metric-name
95-
::namespace
96-
::period
97-
::threshold]
98-
:opt [::actions-enabled
129+
::actions-enabled
99130
::alarm-actions
100131
::alarm-description
101132
::alarm-name
102133
::dimensions
103134
::insufficient-data-actions
104135
::ok-actions
105136
::statistic
106-
::unit]))
137+
::unit
138+
::datapoints-to-alarm
139+
::evaluate-low-sample-count-percentile
140+
::metrics
141+
::period
142+
::threshold
143+
::threshold-metric-id]))
107144

108145
(defresource alarm "AWS::CloudWatch::Alarm" ::alarm)

0 commit comments

Comments
 (0)