Class Alarm.Builder
java.lang.Object
software.amazon.awscdk.services.cloudwatch.Alarm.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Alarm>
- Enclosing class:
Alarm
@Stability(Stable)
public static final class Alarm.Builder
extends Object
implements software.amazon.jsii.Builder<Alarm>
A fluent builder for
Alarm
.-
Method Summary
Modifier and TypeMethodDescriptionactionsEnabled
(Boolean actionsEnabled) Whether the actions for this alarm are enabled.alarmDescription
(String alarmDescription) Description for the alarm.Name of the alarm.build()
comparisonOperator
(ComparisonOperator comparisonOperator) Comparison to use to check if metric is breaching.static Alarm.Builder
datapointsToAlarm
(Number datapointsToAlarm) The number of datapoints that must be breaching to trigger the alarm.evaluateLowSampleCountPercentile
(String evaluateLowSampleCountPercentile) Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.evaluationPeriods
(Number evaluationPeriods) The number of periods over which data is compared to the specified threshold.The metric to add the alarm on.The value against which the specified statistic is compared.treatMissingData
(TreatMissingData treatMissingData) Sets how this alarm is to handle missing data points.
-
Method Details
-
create
@Stability(Stable) public static Alarm.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
Alarm.Builder
.
-
evaluationPeriods
The number of periods over which data is compared to the specified threshold.- Parameters:
evaluationPeriods
- The number of periods over which data is compared to the specified threshold. This parameter is required.- Returns:
this
-
threshold
The value against which the specified statistic is compared.- Parameters:
threshold
- The value against which the specified statistic is compared. This parameter is required.- Returns:
this
-
actionsEnabled
Whether the actions for this alarm are enabled.Default: true
- Parameters:
actionsEnabled
- Whether the actions for this alarm are enabled. This parameter is required.- Returns:
this
-
alarmDescription
Description for the alarm.Default: No description
- Parameters:
alarmDescription
- Description for the alarm. This parameter is required.- Returns:
this
-
alarmName
Name of the alarm.Default: Automatically generated name
- Parameters:
alarmName
- Name of the alarm. This parameter is required.- Returns:
this
-
comparisonOperator
Comparison to use to check if metric is breaching.Default: GreaterThanOrEqualToThreshold
- Parameters:
comparisonOperator
- Comparison to use to check if metric is breaching. This parameter is required.- Returns:
this
-
datapointsToAlarm
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``
- Parameters:
datapointsToAlarm
- The number of datapoints that must be breaching to trigger the alarm. This parameter is required.- Returns:
this
- See Also:
-
evaluateLowSampleCountPercentile
@Stability(Stable) public Alarm.Builder evaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) 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.
- Parameters:
evaluateLowSampleCountPercentile
- Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant. This parameter is required.- Returns:
this
-
treatMissingData
Sets how this alarm is to handle missing data points.Default: TreatMissingData.Missing
- Parameters:
treatMissingData
- Sets how this alarm is to handle missing data points. This parameter is required.- Returns:
this
-
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.
- Parameters:
metric
- The metric to add the alarm on. This parameter is required.- Returns:
this
-
build
-