Class AlarmProps
Properties for Alarms.
Inheritance
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.AWS.CloudWatch.dll
Syntax (csharp)
public class AlarmProps : Object, IAlarmProps, ICreateAlarmOptions
Syntax (vb)
Public Class AlarmProps
Inherits Object
Implements IAlarmProps, ICreateAlarmOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CloudWatch;
Alias alias;
// or add alarms to an existing group
Alias blueGreenAlias;
var alarm = new Alarm(this, "Errors", new AlarmProps {
ComparisonOperator = ComparisonOperator.GREATER_THAN_THRESHOLD,
Threshold = 1,
EvaluationPeriods = 1,
Metric = alias.MetricErrors()
});
var deploymentGroup = new LambdaDeploymentGroup(this, "BlueGreenDeployment", new LambdaDeploymentGroupProps {
Alias = alias,
DeploymentConfig = LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE,
Alarms = new [] { alarm }
});
deploymentGroup.AddAlarm(new Alarm(this, "BlueGreenErrors", new AlarmProps {
ComparisonOperator = ComparisonOperator.GREATER_THAN_THRESHOLD,
Threshold = 1,
EvaluationPeriods = 1,
Metric = blueGreenAlias.MetricErrors()
}));
Synopsis
Constructors
AlarmProps() |
Properties
ActionsEnabled | Whether the actions for this alarm are enabled. |
AlarmDescription | Description for the alarm. |
AlarmName | Name of the alarm. |
ComparisonOperator | Comparison to use to check if metric is breaching. |
DatapointsToAlarm | The number of datapoints that must be breaching to trigger the alarm. |
EvaluateLowSampleCountPercentile | Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant. |
EvaluationPeriods | The number of periods over which data is compared to the specified threshold. |
Metric | The metric to add the alarm on. |
Period | (deprecated) The period over which the specified statistic is applied. |
Statistic | (deprecated) What function to use for aggregating. |
Threshold | The value against which the specified statistic is compared. |
TreatMissingData | Sets how this alarm is to handle missing data points. |
Constructors
AlarmProps()
public AlarmProps()
Properties
ActionsEnabled
Whether the actions for this alarm are enabled.
public Nullable<bool> ActionsEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
AlarmDescription
Description for the alarm.
public string AlarmDescription { get; set; }
Property Value
System.String
Remarks
Default: No description
AlarmName
Name of the alarm.
public string AlarmName { get; set; }
Property Value
System.String
Remarks
Default: Automatically generated name
ComparisonOperator
Comparison to use to check if metric is breaching.
public Nullable<ComparisonOperator> ComparisonOperator { get; set; }
Property Value
System.Nullable<ComparisonOperator>
Remarks
Default: GreaterThanOrEqualToThreshold
DatapointsToAlarm
The number of datapoints that must be breaching to trigger the alarm.
public Nullable<double> DatapointsToAlarm { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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.
Default: evaluationPeriods
EvaluateLowSampleCountPercentile
Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
public string EvaluateLowSampleCountPercentile { get; set; }
Property Value
System.String
Remarks
Used only for alarms that are based on percentiles.
Default: - Not configured.
EvaluationPeriods
The number of periods over which data is compared to the specified threshold.
public double EvaluationPeriods { get; set; }
Property Value
System.Double
Metric
The metric to add the alarm on.
public IMetric Metric { get; set; }
Property Value
Remarks
Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
Period
(deprecated) The period over which the specified statistic is applied.
public Duration Period { get; set; }
Property Value
Remarks
Cannot be used with MathExpression
objects.
Default: - The period from the metric
Stability: Deprecated
Statistic
(deprecated) What function to use for aggregating.
public string Statistic { get; set; }
Property Value
System.String
Remarks
Can be one of the following:
Cannot be used with MathExpression
objects.
Default: - The statistic from the metric
Stability: Deprecated
Threshold
The value against which the specified statistic is compared.
public double Threshold { get; set; }
Property Value
System.Double
TreatMissingData
Sets how this alarm is to handle missing data points.
public Nullable<TreatMissingData> TreatMissingData { get; set; }
Property Value
System.Nullable<TreatMissingData>
Remarks
Default: TreatMissingData.Missing