Interface AlarmProps
- All Superinterfaces:
CreateAlarmOptions
,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AlarmProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:36.767Z")
@Stability(Stable)
public interface AlarmProps
extends software.amazon.jsii.JsiiSerializable, CreateAlarmOptions
Properties for Alarms.
Example:
import software.amazon.awscdk.services.cloudwatch.*; Alias alias; // or add alarms to an existing group Alias blueGreenAlias; Alarm alarm = Alarm.Builder.create(this, "Errors") .comparisonOperator(ComparisonOperator.GREATER_THAN_THRESHOLD) .threshold(1) .evaluationPeriods(1) .metric(alias.metricErrors()) .build(); LambdaDeploymentGroup deploymentGroup = LambdaDeploymentGroup.Builder.create(this, "BlueGreenDeployment") .alias(alias) .deploymentConfig(LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE) .alarms(List.of(alarm)) .build(); deploymentGroup.addAlarm(Alarm.Builder.create(this, "BlueGreenErrors") .comparisonOperator(ComparisonOperator.GREATER_THAN_THRESHOLD) .threshold(1) .evaluationPeriods(1) .metric(blueGreenAlias.metricErrors()) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forAlarmProps
static final class
An implementation forAlarmProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic AlarmProps.Builder
builder()
The metric to add the alarm on.Methods inherited from interface software.amazon.awscdk.services.cloudwatch.CreateAlarmOptions
getActionsEnabled, getAlarmDescription, getAlarmName, getComparisonOperator, getDatapointsToAlarm, getEvaluateLowSampleCountPercentile, getEvaluationPeriods, getPeriod, getStatistic, getThreshold, getTreatMissingData
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getMetric
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.
-
builder
- Returns:
- a
AlarmProps.Builder
ofAlarmProps
-