Class CfnAlarmProps.Builder
java.lang.Object
software.amazon.awscdk.services.lightsail.CfnAlarmProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnAlarmProps>
- Enclosing interface:
CfnAlarmProps
@Stability(Stable)
public static final class CfnAlarmProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnAlarmProps>
A builder for
CfnAlarmProps
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofCfnAlarmProps.getAlarmName()
build()
Builds the configured instance.comparisonOperator
(String comparisonOperator) Sets the value ofCfnAlarmProps.getComparisonOperator()
contactProtocols
(List<String> contactProtocols) Sets the value ofCfnAlarmProps.getContactProtocols()
datapointsToAlarm
(Number datapointsToAlarm) Sets the value ofCfnAlarmProps.getDatapointsToAlarm()
evaluationPeriods
(Number evaluationPeriods) Sets the value ofCfnAlarmProps.getEvaluationPeriods()
metricName
(String metricName) Sets the value ofCfnAlarmProps.getMetricName()
monitoredResourceName
(String monitoredResourceName) Sets the value ofCfnAlarmProps.getMonitoredResourceName()
notificationEnabled
(Boolean notificationEnabled) Sets the value ofCfnAlarmProps.getNotificationEnabled()
notificationEnabled
(IResolvable notificationEnabled) Sets the value ofCfnAlarmProps.getNotificationEnabled()
notificationTriggers
(List<String> notificationTriggers) Sets the value ofCfnAlarmProps.getNotificationTriggers()
Sets the value ofCfnAlarmProps.getThreshold()
treatMissingData
(String treatMissingData) Sets the value ofCfnAlarmProps.getTreatMissingData()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
alarmName
Sets the value ofCfnAlarmProps.getAlarmName()
- Parameters:
alarmName
- The name of the alarm. This parameter is required.- Returns:
this
-
comparisonOperator
Sets the value ofCfnAlarmProps.getComparisonOperator()
- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specified statistic and threshold. This parameter is required.- Returns:
this
-
evaluationPeriods
Sets the value ofCfnAlarmProps.getEvaluationPeriods()
- Parameters:
evaluationPeriods
- The number of periods over which data is compared to the specified threshold. This parameter is required.- Returns:
this
-
metricName
Sets the value ofCfnAlarmProps.getMetricName()
- Parameters:
metricName
- The name of the metric associated with the alarm. This parameter is required.- Returns:
this
-
monitoredResourceName
Sets the value ofCfnAlarmProps.getMonitoredResourceName()
- Parameters:
monitoredResourceName
- The name of the Lightsail resource that the alarm monitors. This parameter is required.- Returns:
this
-
threshold
Sets the value ofCfnAlarmProps.getThreshold()
- Parameters:
threshold
- The value against which the specified statistic is compared. This parameter is required.- Returns:
this
-
contactProtocols
Sets the value ofCfnAlarmProps.getContactProtocols()
- Parameters:
contactProtocols
- The contact protocols for the alarm, such asEmail
,SMS
(text messaging), or both. Allowed Values :Email
|SMS
- Returns:
this
-
datapointsToAlarm
Sets the value ofCfnAlarmProps.getDatapointsToAlarm()
- Parameters:
datapointsToAlarm
- The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARM
state.- Returns:
this
-
notificationEnabled
Sets the value ofCfnAlarmProps.getNotificationEnabled()
- Parameters:
notificationEnabled
- A Boolean value indicating whether the alarm is enabled.- Returns:
this
-
notificationEnabled
@Stability(Stable) public CfnAlarmProps.Builder notificationEnabled(IResolvable notificationEnabled) Sets the value ofCfnAlarmProps.getNotificationEnabled()
- Parameters:
notificationEnabled
- A Boolean value indicating whether the alarm is enabled.- Returns:
this
-
notificationTriggers
@Stability(Stable) public CfnAlarmProps.Builder notificationTriggers(List<String> notificationTriggers) Sets the value ofCfnAlarmProps.getNotificationTriggers()
- Parameters:
notificationTriggers
- The alarm states that trigger a notification.To specify the
OK
andINSUFFICIENT_DATA
values, you must also specifyContactProtocols
values. Otherwise, theOK
andINSUFFICIENT_DATA
values will not take effect and the stack will drift.Allowed Values :
OK
|ALARM
|INSUFFICIENT_DATA
- Returns:
this
-
treatMissingData
Sets the value ofCfnAlarmProps.getTreatMissingData()
- Parameters:
treatMissingData
- Specifies how the alarm handles missing data points. An alarm can treat missing data in the following ways:breaching
- Assumes the missing data is not within the threshold. Missing data counts towards the number of times that the metric is not within the threshold.notBreaching
- Assumes the missing data is within the threshold. Missing data does not count towards the number of times that the metric is not within the threshold.ignore
- Ignores the missing data. Maintains the current alarm state.missing
- Missing data is treated as missing.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnAlarmProps>
- Returns:
- a new instance of
CfnAlarmProps
- Throws:
NullPointerException
- if any required attribute was not provided
-