Skip to content

Commit

Permalink
Update cloudwatch alarm spec (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Sumpter authored and Sam Hewitt committed Oct 9, 2019
1 parent 37b7de8 commit 7ed0392
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions src/crucible/aws/cloudwatch.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,22 @@
(s/def ::comparison-operator (spec-or-ref #{"GreaterThanOrEqualToThreshold"
"GreaterThanThreshold"
"LessThanThreshold"
"LessThanOrEqualToThreshold"}))
"LessThanOrEqualToThreshold"
"LessThanLowerThreshold"
"LessThanLowerOrGreaterThanUpperThreshold"}))

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

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

(s/def ::datapoints-to-alarm (spec-or-ref int?))

(s/def ::dimension (s/keys :req [::name ::value]))

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

(s/def ::evaluate-low-sample-count-percentile (spec-or-ref string?))

(s/def ::evaluation-periods (spec-or-ref pos-int?))

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

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

(s/def ::expression (spec-or-ref string?))

(s/def ::id (spec-or-ref string?))

(s/def ::label (spec-or-ref string?))

(s/def ::metric (s/keys :opt [::dimensions
::metric-name
::namespace]))

(s/def ::metric-stat (s/keys :req [::metric
::period
::stat]
:opt [::unit]))

(s/def ::return-data (spec-or-ref boolean?))

(s/def ::metric-data-query (s/keys :req [::id]
:opt [::expression
::label
::metric-stat
::return-data]))

(s/def ::metrics (s/coll-of ::metric-data-query))

(s/def ::namespace (spec-or-ref string?))

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

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

(s/def ::threshold-metric-id (spec-or-ref string?))

(s/def ::treat-missing-data (spec-or-ref #{"breaching"
"notBreaching"
"ignore"
Expand Down Expand Up @@ -90,19 +123,23 @@
"None"}))

(s/def ::alarm (s/keys :req [::comparison-operator
::evaluation-periods
::evaluation-periods]
:opt [::namespace
::metric-name
::namespace
::period
::threshold]
:opt [::actions-enabled
::actions-enabled
::alarm-actions
::alarm-description
::alarm-name
::dimensions
::insufficient-data-actions
::ok-actions
::statistic
::unit]))
::unit
::datapoints-to-alarm
::evaluate-low-sample-count-percentile
::metrics
::period
::threshold
::threshold-metric-id]))

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

0 comments on commit 7ed0392

Please sign in to comment.