@Generated(value="jsii-pacmak/1.60.0 (build ebcefe6)", date="2022-06-22T23:27:53.457Z") public interface AlarmProps extends CreateAlarmOptions
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());
Modifier and Type | Interface and Description |
---|---|
static class |
AlarmProps.Builder
A builder for
AlarmProps |
static class |
AlarmProps.Jsii$Proxy
An implementation for
AlarmProps |
Modifier and Type | Method and Description |
---|---|
static AlarmProps.Builder |
builder() |
IMetric |
getMetric()
The metric to add the alarm on.
|
getActionsEnabled, getAlarmDescription, getAlarmName, getComparisonOperator, getDatapointsToAlarm, getEvaluateLowSampleCountPercentile, getEvaluationPeriods, getPeriod, getStatistic, getThreshold, getTreatMissingData
IMetric getMetric()
Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
static AlarmProps.Builder builder()
builder
in interface CreateAlarmOptions
AlarmProps.Builder
of AlarmProps