An alarm on a CloudWatch metric.
import { Alarm } from 'aws-cdk-lib/aws-cloudwatch';Or use the module namespace:
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
// cloudwatch.AlarmConfiguration passed to the constructor as AlarmProps.
metricRequiredIMetricThe metric to add the alarm on. Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
CreateAlarmOptionsevaluationPeriodsRequiredinherited from CreateAlarmOptionsnumberThe number of periods over which data is compared to the specified threshold.
thresholdRequiredinherited from CreateAlarmOptionsnumberThe value against which the specified statistic is compared.
actionsEnabledOptionalinherited from CreateAlarmOptionsbooleanWhether the actions for this alarm are enabled.
Default: true
alarmDescriptionOptionalinherited from CreateAlarmOptionsstringDescription for the alarm.
Default: No description
alarmNameOptionalinherited from CreateAlarmOptionsstringName of the alarm.
Default: Automatically generated name
comparisonOperatorOptionalinherited from CreateAlarmOptionsComparisonOperatorComparison to use to check if metric is breaching.
Default: GreaterThanOrEqualToThreshold
datapointsToAlarmOptionalinherited from CreateAlarmOptionsnumberThe 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``
evaluateLowSampleCountPercentileOptionalinherited from CreateAlarmOptionsstringSpecifies 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.
treatMissingDataOptionalinherited from CreateAlarmOptionsTreatMissingDataSets how this alarm is to handle missing data points.
Default: TreatMissingData.Missing
Everything you need to know about Amazon CloudWatch on one page. HD quality, print-friendly.
Download Free Infographicaws-cloudwatch