Show / Hide Table of Contents

Interface ICfnAlarmProps

Properties for defining a CfnAlarm.

Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.AWS.CloudWatch.dll
Syntax (csharp)
public interface ICfnAlarmProps
Syntax (vb)
Public Interface ICfnAlarmProps
Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudWatch;

CfnAlarmProps cfnAlarmProps = new CfnAlarmProps {
    ComparisonOperator = "comparisonOperator",
    EvaluationPeriods = 123,

    // the properties below are optional
    ActionsEnabled = false,
    AlarmActions = new [] { "alarmActions" },
    AlarmDescription = "alarmDescription",
    AlarmName = "alarmName",
    DatapointsToAlarm = 123,
    Dimensions = new [] { new DimensionProperty {
        Name = "name",
        Value = "value"
    } },
    EvaluateLowSampleCountPercentile = "evaluateLowSampleCountPercentile",
    ExtendedStatistic = "extendedStatistic",
    InsufficientDataActions = new [] { "insufficientDataActions" },
    MetricName = "metricName",
    Metrics = new [] { new MetricDataQueryProperty {
        Id = "id",

        // the properties below are optional
        AccountId = "accountId",
        Expression = "expression",
        Label = "label",
        MetricStat = new MetricStatProperty {
            Metric = new MetricProperty {
                Dimensions = new [] { new DimensionProperty {
                    Name = "name",
                    Value = "value"
                } },
                MetricName = "metricName",
                Namespace = "namespace"
            },
            Period = 123,
            Stat = "stat",

            // the properties below are optional
            Unit = "unit"
        },
        Period = 123,
        ReturnData = false
    } },
    Namespace = "namespace",
    OkActions = new [] { "okActions" },
    Period = 123,
    Statistic = "statistic",
    Threshold = 123,
    ThresholdMetricId = "thresholdMetricId",
    TreatMissingData = "treatMissingData",
    Unit = "unit"
};

Synopsis

Properties

ActionsEnabled

Indicates whether actions should be executed during any changes to the alarm state.

AlarmActions

The list of actions to execute when this alarm transitions into an ALARM state from any other state.

AlarmDescription

The description of the alarm.

AlarmName

The name of the alarm.

ComparisonOperator

The arithmetic operation to use when comparing the specified statistic and threshold.

DatapointsToAlarm

The number of datapoints that must be breaching to trigger the alarm.

Dimensions

The dimensions for the metric associated with the alarm.

EvaluateLowSampleCountPercentile

Used only for alarms based on percentiles.

EvaluationPeriods

The number of periods over which data is compared to the specified threshold.

ExtendedStatistic

The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.

InsufficientDataActions

The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.

MetricName

The name of the metric associated with the alarm.

Metrics

An array that enables you to create an alarm based on the result of a metric math expression.

Namespace

The namespace of the metric associated with the alarm.

OkActions

The actions to execute when this alarm transitions to the OK state from any other state.

Period

The period, in seconds, over which the statistic is applied.

Statistic

The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use ExtendedStatistic .

Threshold

The value to compare with the specified statistic.

ThresholdMetricId

In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND function used as the threshold for the alarm.

TreatMissingData

Sets how this alarm is to handle missing data points.

Unit

The unit of the metric associated with the alarm.

Properties

ActionsEnabled

Indicates whether actions should be executed during any changes to the alarm state.

virtual object ActionsEnabled { get; }
Property Value

System.Object

Remarks

The default is TRUE.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-actionsenabled

AlarmActions

The list of actions to execute when this alarm transitions into an ALARM state from any other state.

virtual string[] AlarmActions { get; }
Property Value

System.String[]

Remarks

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 .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-alarmactions

AlarmDescription

The description of the alarm.

virtual string AlarmDescription { get; }
Property Value

System.String

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-alarmdescription

AlarmName

The name of the alarm.

virtual string AlarmName { get; }
Property Value

System.String

Remarks

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-alarmname

ComparisonOperator

The arithmetic operation to use when comparing the specified statistic and threshold.

string ComparisonOperator { get; }
Property Value

System.String

Remarks

The specified statistic value is used as the first operand.

You can specify the following values: GreaterThanThreshold , GreaterThanOrEqualToThreshold , LessThanThreshold , or LessThanOrEqualToThreshold .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-comparisonoperator

DatapointsToAlarm

The number of datapoints that must be breaching to trigger the alarm.

virtual Nullable<double> DatapointsToAlarm { get; }
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, and the value that you set for EvaluationPeriods 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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarm-datapointstoalarm

Dimensions

The dimensions for the metric associated with the alarm.

virtual object Dimensions { get; }
Property Value

System.Object

Remarks

For an alarm based on a math expression, you can't specify Dimensions . Instead, you use Metrics .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-dimension

EvaluateLowSampleCountPercentile

Used only for alarms based on percentiles.

virtual string EvaluateLowSampleCountPercentile { get; }
Property Value

System.String

Remarks

If ignore , the alarm state does not change during periods with too few data points to be statistically significant. If evaluate or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-evaluatelowsamplecountpercentile

EvaluationPeriods

The number of periods over which data is compared to the specified threshold.

double EvaluationPeriods { get; }
Property Value

System.Double

Remarks

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, and DatapointsToAlarm is the M.

For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-evaluationperiods

ExtendedStatistic

The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.

virtual string ExtendedStatistic { get; }
Property Value

System.String

Remarks

For an alarm based on a metric, you must specify either Statistic or ExtendedStatistic but not both.

For an alarm based on a math expression, you can't specify ExtendedStatistic . Instead, you use Metrics .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-extendedstatistic

InsufficientDataActions

The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.

virtual string[] InsufficientDataActions { get; }
Property Value

System.String[]

Remarks

Each action is specified as an Amazon Resource Name (ARN).

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-insufficientdataactions

MetricName

The name of the metric associated with the alarm.

virtual string MetricName { get; }
Property Value

System.String

Remarks

This is required for an alarm based on a metric. For an alarm based on a math expression, you use Metrics instead and you can't specify MetricName .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-metricname

Metrics

An array that enables you to create an alarm based on the result of a metric math expression.

virtual object Metrics { get; }
Property Value

System.Object

Remarks

Each item in the array either retrieves a metric or performs a math expression.

If you specify the Metrics parameter, you cannot specify MetricName , Dimensions , Period , Namespace , Statistic , ExtendedStatistic , or Unit .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarm-metrics

Namespace

The namespace of the metric associated with the alarm.

virtual string Namespace { get; }
Property Value

System.String

Remarks

This is required for an alarm based on a metric. For an alarm based on a math expression, you can't specify Namespace and you use Metrics instead.

For a list of namespaces for metrics from AWS services, see AWS Services That Publish CloudWatch Metrics.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-namespace

OkActions

The actions to execute when this alarm transitions to the OK state from any other state.

virtual string[] OkActions { get; }
Property Value

System.String[]

Remarks

Each action is specified as an Amazon Resource Name (ARN).

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-okactions

Period

The period, in seconds, over which the statistic is applied.

virtual Nullable<double> Period { get; }
Property Value

System.Nullable<System.Double>

Remarks

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 the Metrics parameter.

Minimum: 10

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-period

Statistic

The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use ExtendedStatistic .

virtual string Statistic { get; }
Property Value

System.String

Remarks

For an alarm based on a metric, you must specify either Statistic or ExtendedStatistic but not both.

For an alarm based on a math expression, you can't specify Statistic . Instead, you use Metrics .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-statistic

Threshold

The value to compare with the specified statistic.

virtual Nullable<double> Threshold { get; }
Property Value

System.Nullable<System.Double>

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-threshold

ThresholdMetricId

In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND function used as the threshold for the alarm.

virtual string ThresholdMetricId { get; }
Property Value

System.String

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-dynamic-threshold

TreatMissingData

Sets how this alarm is to handle missing data points.

virtual string TreatMissingData { get; }
Property Value

System.String

Remarks

Valid values are breaching , notBreaching , ignore , and missing . 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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-treatmissingdata

Unit

The unit of the metric associated with the alarm.

virtual string Unit { get; }
Property Value

System.String

Remarks

Specify this only if you are creating an alarm based on a single metric. Do not specify this if you are specifying a Metrics 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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-unit

Back to top Generated by DocFX