Class CfnAlarmProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnAlarmProps>
- Enclosing interface:
CfnAlarmProps
CfnAlarmProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactionsEnabled
(Boolean actionsEnabled) Sets the value ofCfnAlarmProps.getActionsEnabled()
actionsEnabled
(IResolvable actionsEnabled) Sets the value ofCfnAlarmProps.getActionsEnabled()
alarmActions
(List<String> alarmActions) Sets the value ofCfnAlarmProps.getAlarmActions()
alarmDescription
(String alarmDescription) Sets the value ofCfnAlarmProps.getAlarmDescription()
Sets the value ofCfnAlarmProps.getAlarmName()
build()
Builds the configured instance.comparisonOperator
(String comparisonOperator) Sets the value ofCfnAlarmProps.getComparisonOperator()
datapointsToAlarm
(Number datapointsToAlarm) Sets the value ofCfnAlarmProps.getDatapointsToAlarm()
dimensions
(List<? extends Object> dimensions) Sets the value ofCfnAlarmProps.getDimensions()
dimensions
(IResolvable dimensions) Sets the value ofCfnAlarmProps.getDimensions()
evaluateLowSampleCountPercentile
(String evaluateLowSampleCountPercentile) Sets the value ofCfnAlarmProps.getEvaluateLowSampleCountPercentile()
evaluationPeriods
(Number evaluationPeriods) Sets the value ofCfnAlarmProps.getEvaluationPeriods()
extendedStatistic
(String extendedStatistic) Sets the value ofCfnAlarmProps.getExtendedStatistic()
insufficientDataActions
(List<String> insufficientDataActions) Sets the value ofCfnAlarmProps.getInsufficientDataActions()
metricName
(String metricName) Sets the value ofCfnAlarmProps.getMetricName()
Sets the value ofCfnAlarmProps.getMetrics()
metrics
(IResolvable metrics) Sets the value ofCfnAlarmProps.getMetrics()
Sets the value ofCfnAlarmProps.getNamespace()
Sets the value ofCfnAlarmProps.getOkActions()
Sets the value ofCfnAlarmProps.getPeriod()
Sets the value ofCfnAlarmProps.getStatistic()
Sets the value ofCfnAlarmProps.getTags()
Sets the value ofCfnAlarmProps.getThreshold()
thresholdMetricId
(String thresholdMetricId) Sets the value ofCfnAlarmProps.getThresholdMetricId()
treatMissingData
(String treatMissingData) Sets the value ofCfnAlarmProps.getTreatMissingData()
Sets the value ofCfnAlarmProps.getUnit()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
comparisonOperator
Sets the value ofCfnAlarmProps.getComparisonOperator()
- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specified statistic and threshold. This parameter is required. The specified statistic value is used as the first operand.- 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. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N, andDatapointsToAlarm
is the M.For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide .
- Returns:
this
-
actionsEnabled
Sets the value ofCfnAlarmProps.getActionsEnabled()
- Parameters:
actionsEnabled
- Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.- Returns:
this
-
actionsEnabled
Sets the value ofCfnAlarmProps.getActionsEnabled()
- Parameters:
actionsEnabled
- Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.- Returns:
this
-
alarmActions
Sets the value ofCfnAlarmProps.getAlarmActions()
- Parameters:
alarmActions
- The list of actions to execute when this alarm transitions into an ALARM state from any other state. Specify each action as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutMetricAlarm in the Amazon CloudWatch API Reference .- Returns:
this
-
alarmDescription
Sets the value ofCfnAlarmProps.getAlarmDescription()
- Parameters:
alarmDescription
- The description of the alarm.- Returns:
this
-
alarmName
Sets the value ofCfnAlarmProps.getAlarmName()
- Parameters:
alarmName
- The name of the alarm. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the alarm name.If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
- Returns:
this
-
datapointsToAlarm
Sets the value ofCfnAlarmProps.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, and the value that you set forEvaluationPeriods
is the N value. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide .If you omit this parameter, CloudWatch uses the same value here that you set for
EvaluationPeriods
, and the alarm goes to alarm state if that many consecutive periods are breaching.- Returns:
this
-
dimensions
Sets the value ofCfnAlarmProps.getDimensions()
- Parameters:
dimensions
- The dimensions for the metric associated with the alarm. For an alarm based on a math expression, you can't specifyDimensions
. Instead, you useMetrics
.- Returns:
this
-
dimensions
Sets the value ofCfnAlarmProps.getDimensions()
- Parameters:
dimensions
- The dimensions for the metric associated with the alarm. For an alarm based on a math expression, you can't specifyDimensions
. Instead, you useMetrics
.- Returns:
this
-
evaluateLowSampleCountPercentile
@Stability(Stable) public CfnAlarmProps.Builder evaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) Sets the value ofCfnAlarmProps.getEvaluateLowSampleCountPercentile()
- Parameters:
evaluateLowSampleCountPercentile
- Used only for alarms based on percentiles. Ifignore
, the alarm state does not change during periods with too few data points to be statistically significant. Ifevaluate
or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.- Returns:
this
-
extendedStatistic
Sets the value ofCfnAlarmProps.getExtendedStatistic()
- Parameters:
extendedStatistic
- The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100. For an alarm based on a metric, you must specify eitherStatistic
orExtendedStatistic
but not both.For an alarm based on a math expression, you can't specify
ExtendedStatistic
. Instead, you useMetrics
.- Returns:
this
-
insufficientDataActions
@Stability(Stable) public CfnAlarmProps.Builder insufficientDataActions(List<String> insufficientDataActions) Sets the value ofCfnAlarmProps.getInsufficientDataActions()
- Parameters:
insufficientDataActions
- The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
this
-
metricName
Sets the value ofCfnAlarmProps.getMetricName()
- Parameters:
metricName
- The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm based on a math expression, you useMetrics
instead and you can't specifyMetricName
.- Returns:
this
-
metrics
Sets the value ofCfnAlarmProps.getMetrics()
- Parameters:
metrics
- An array that enables you to create an alarm based on the result of a metric math expression. Each item in the array either retrieves a metric or performs a math expression.If you specify the
Metrics
parameter, you cannot specifyMetricName
,Dimensions
,Period
,Namespace
,Statistic
,ExtendedStatistic
, orUnit
.- Returns:
this
-
metrics
Sets the value ofCfnAlarmProps.getMetrics()
- Parameters:
metrics
- An array that enables you to create an alarm based on the result of a metric math expression. Each item in the array either retrieves a metric or performs a math expression.If you specify the
Metrics
parameter, you cannot specifyMetricName
,Dimensions
,Period
,Namespace
,Statistic
,ExtendedStatistic
, orUnit
.- Returns:
this
-
namespace
Sets the value ofCfnAlarmProps.getNamespace()
- Parameters:
namespace
- The namespace of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm based on a math expression, you can't specifyNamespace
and you useMetrics
instead.For a list of namespaces for metrics from AWS services, see AWS Services That Publish CloudWatch Metrics.
- Returns:
this
-
okActions
Sets the value ofCfnAlarmProps.getOkActions()
- Parameters:
okActions
- The actions to execute when this alarm transitions to theOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
this
-
period
Sets the value ofCfnAlarmProps.getPeriod()
- Parameters:
period
- The period, in seconds, over which the statistic is applied. This is required for an alarm based on a metric. Valid values are 10, 30, 60, and any multiple of 60.For an alarm based on a math expression, you can't specify
Period
, and instead you use theMetrics
parameter.Minimum: 10
- Returns:
this
-
statistic
Sets the value ofCfnAlarmProps.getStatistic()
- Parameters:
statistic
- The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, useExtendedStatistic
. For an alarm based on a metric, you must specify eitherStatistic
orExtendedStatistic
but not both.For an alarm based on a math expression, you can't specify
Statistic
. Instead, you useMetrics
.- Returns:
this
-
tags
Sets the value ofCfnAlarmProps.getTags()
- Parameters:
tags
- A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have thecloudwatch:TagResource
permission.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
- Returns:
this
-
threshold
Sets the value ofCfnAlarmProps.getThreshold()
- Parameters:
threshold
- The value to compare with the specified statistic.- Returns:
this
-
thresholdMetricId
Sets the value ofCfnAlarmProps.getThresholdMetricId()
- Parameters:
thresholdMetricId
- In an alarm based on an anomaly detection model, this is the ID of theANOMALY_DETECTION_BAND
function used as the threshold for the alarm.- Returns:
this
-
treatMissingData
Sets the value ofCfnAlarmProps.getTreatMissingData()
- Parameters:
treatMissingData
- Sets how this alarm is to handle missing data points. Valid values arebreaching
,notBreaching
,ignore
, andmissing
. For more information, see Configuring How CloudWatch Alarms Treat Missing Data in the Amazon CloudWatch User Guide .If you omit this parameter, the default behavior of
missing
is used.- Returns:
this
-
unit
Sets the value ofCfnAlarmProps.getUnit()
- Parameters:
unit
- The unit of the metric associated with the alarm. Specify this only if you are creating an alarm based on a single metric. Do not specify this if you are specifying aMetrics
array.You can specify the following values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None.
- 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
-