Skip to content
Permalink
Browse files

Update cloudwatch alarm spec (#189)

  • Loading branch information...
csumpter authored and shooit committed Oct 9, 2019
1 parent 37b7de8 commit 7ed0392ff1437399e18fecf8f64908f642a6718c
Showing with 44 additions and 7 deletions.
  1. +44 −7 src/crucible/aws/cloudwatch.clj
@@ -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.
@@ -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)
@@ -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"
@@ -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.
You can’t perform that action at this time.