Class AlarmProps.Builder
java.lang.Object
software.amazon.awscdk.services.cloudwatch.AlarmProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AlarmProps>
- Enclosing interface:
- AlarmProps
@Stability(Stable)
public static final class AlarmProps.Builder
extends Object
implements software.amazon.jsii.Builder<AlarmProps>
A builder for
AlarmProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactionsEnabled
(Boolean actionsEnabled) Sets the value ofCreateAlarmOptions.getActionsEnabled()
alarmDescription
(String alarmDescription) Sets the value ofCreateAlarmOptions.getAlarmDescription()
Sets the value ofCreateAlarmOptions.getAlarmName()
build()
Builds the configured instance.comparisonOperator
(ComparisonOperator comparisonOperator) Sets the value ofCreateAlarmOptions.getComparisonOperator()
datapointsToAlarm
(Number datapointsToAlarm) Sets the value ofCreateAlarmOptions.getDatapointsToAlarm()
evaluateLowSampleCountPercentile
(String evaluateLowSampleCountPercentile) Sets the value ofCreateAlarmOptions.getEvaluateLowSampleCountPercentile()
evaluationPeriods
(Number evaluationPeriods) Sets the value ofCreateAlarmOptions.getEvaluationPeriods()
Sets the value ofAlarmProps.getMetric()
Sets the value ofCreateAlarmOptions.getThreshold()
treatMissingData
(TreatMissingData treatMissingData) Sets the value ofCreateAlarmOptions.getTreatMissingData()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
metric
Sets the value ofAlarmProps.getMetric()
- Parameters:
metric
- The metric to add the alarm on. This parameter is required. Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.- Returns:
this
-
evaluationPeriods
Sets the value ofCreateAlarmOptions.getEvaluationPeriods()
- Parameters:
evaluationPeriods
- The number of periods over which data is compared to the specified threshold. This parameter is required.- Returns:
this
-
threshold
Sets the value ofCreateAlarmOptions.getThreshold()
- Parameters:
threshold
- The value against which the specified statistic is compared. This parameter is required.- Returns:
this
-
actionsEnabled
Sets the value ofCreateAlarmOptions.getActionsEnabled()
- Parameters:
actionsEnabled
- Whether the actions for this alarm are enabled.- Returns:
this
-
alarmDescription
Sets the value ofCreateAlarmOptions.getAlarmDescription()
- Parameters:
alarmDescription
- Description for the alarm.- Returns:
this
-
alarmName
Sets the value ofCreateAlarmOptions.getAlarmName()
- Parameters:
alarmName
- Name of the alarm.- Returns:
this
-
comparisonOperator
@Stability(Stable) public AlarmProps.Builder comparisonOperator(ComparisonOperator comparisonOperator) Sets the value ofCreateAlarmOptions.getComparisonOperator()
- Parameters:
comparisonOperator
- Comparison to use to check if metric is breaching.- Returns:
this
-
datapointsToAlarm
Sets the value ofCreateAlarmOptions.getDatapointsToAlarm()
- Parameters:
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.- Returns:
this
-
evaluateLowSampleCountPercentile
@Stability(Stable) public AlarmProps.Builder evaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) Sets the value ofCreateAlarmOptions.getEvaluateLowSampleCountPercentile()
- 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. Used only for alarms that are based on percentiles.- Returns:
this
-
treatMissingData
Sets the value ofCreateAlarmOptions.getTreatMissingData()
- Parameters:
treatMissingData
- Sets how this alarm is to handle missing data points.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<AlarmProps>
- Returns:
- a new instance of
AlarmProps
- Throws:
NullPointerException
- if any required attribute was not provided
-