AlarmProps¶
-
class
aws_cdk.aws_cloudwatch.
AlarmProps
(*, evaluation_periods, threshold, actions_enabled=None, alarm_description=None, alarm_name=None, comparison_operator=None, datapoints_to_alarm=None, evaluate_low_sample_count_percentile=None, period=None, statistic=None, treat_missing_data=None, metric)¶ Bases:
aws_cdk.aws_cloudwatch.CreateAlarmOptions
Properties for Alarms.
- Parameters
evaluation_periods (
Union
[int
,float
]) – The number of periods over which data is compared to the specified threshold.threshold (
Union
[int
,float
]) – The value against which the specified statistic is compared.actions_enabled (
Optional
[bool
]) – Whether the actions for this alarm are enabled. Default: truealarm_description (
Optional
[str
]) – Description for the alarm. Default: No descriptionalarm_name (
Optional
[str
]) – Name of the alarm. Default: Automatically generated namecomparison_operator (
Optional
[ComparisonOperator
]) – Comparison to use to check if metric is breaching. Default: GreaterThanOrEqualToThresholddatapoints_to_alarm (
Union
[int
,float
,None
]) – The number of datapoints that must be breaching to trigger the alarm. This is used only if you are setting an “M out of N” alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide. Default:evaluationPeriods
evaluate_low_sample_count_percentile (
Optional
[str
]) – Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant. Used only for alarms that are based on percentiles. Default: - Not configured.period (
Optional
[Duration
]) – (deprecated) The period over which the specified statistic is applied. Cannot be used withMathExpression
objects. Default: - The period from the metricstatistic (
Optional
[str
]) – (deprecated) What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Cannot be used withMathExpression
objects. Default: - The statistic from the metrictreat_missing_data (
Optional
[TreatMissingData
]) – Sets how this alarm is to handle missing data points. Default: TreatMissingData.Missingmetric (
IMetric
) – The metric to add the alarm on. Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
Attributes
-
actions_enabled
¶ Whether the actions for this alarm are enabled.
- Default
true
- Return type
Optional
[bool
]
-
alarm_description
¶ Description for the alarm.
- Default
No description
- Return type
Optional
[str
]
-
alarm_name
¶ Name of the alarm.
- Default
Automatically generated name
- Return type
Optional
[str
]
-
comparison_operator
¶ Comparison to use to check if metric is breaching.
- Default
GreaterThanOrEqualToThreshold
- Return type
Optional
[ComparisonOperator
]
-
datapoints_to_alarm
¶ The number of datapoints that must be breaching to trigger the alarm.
This is used only if you are setting an “M out of N” alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
- Default
evaluationPeriods
- See
- Return type
Union
[int
,float
,None
]
-
evaluate_low_sample_count_percentile
¶ Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
Used only for alarms that are based on percentiles.
- Default
Not configured.
- Return type
Optional
[str
]
-
evaluation_periods
¶ The number of periods over which data is compared to the specified threshold.
- Return type
Union
[int
,float
]
-
metric
¶ The metric to add the alarm on.
Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
- Return type
-
period
¶ (deprecated) The period over which the specified statistic is applied.
Cannot be used with
MathExpression
objects.- Default
The period from the metric
- Deprecated
Use
metric.with({ period: ... })
to encode the period into the Metric object- Stability
deprecated
- Return type
Optional
[Duration
]
-
statistic
¶ (deprecated) What function to use for aggregating.
Can be one of the following:
“Minimum” | “min”
“Maximum” | “max”
“Average” | “avg”
“Sum” | “sum”
“SampleCount | “n”
“pNN.NN”
Cannot be used with
MathExpression
objects.- Default
The statistic from the metric
- Deprecated
Use
metric.with({ statistic: ... })
to encode the period into the Metric object- Stability
deprecated
- Return type
Optional
[str
]
-
threshold
¶ The value against which the specified statistic is compared.
- Return type
Union
[int
,float
]
-
treat_missing_data
¶ Sets how this alarm is to handle missing data points.
- Default
TreatMissingData.Missing
- Return type
Optional
[TreatMissingData
]