aws::cloudwatch-metric-alarm

Creates a CloudWatch metric alarm.

Example

aws::cloudwatch-metric-alarm metric-alarm-example-1
    name: "metric-alarm-example-1"
    description: "metric-alarm-example-1"
    comparison-operator: "GreaterThanOrEqualToThreshold"
    threshold: 0.1
    evaluation-periods: 1
    metric-name: "CPUUtilization"
    period: 60
    namespace: "AWS/EC2"
    statistic: "SampleCount"
end
aws::cloudwatch-metric-alarm metric-alarm-example-2
    name: "metric-alarm-example-2"
    description: "metric-alarm-example-2"
    comparison-operator: "GreaterThanOrEqualToThreshold"
    threshold: 0.1
    evaluation-periods: 1

    metric
        id: "e1"
        expression: 'SUM(METRICS())'
        label: "Expression1"
        return-data: true
    end

    metric
        id: "m1"
        metric-name: "CPUUtilization"
        namespace: "AWS/EC2"
        period: 120
        stat: "SampleCount"
        return-data: false
    end
end

Attributes

Attribute Description
name The name of the Metric Alarm. (Required)
actions-enabled Indicates if actions are to be executed when reaches the Metric Alarm state. Defaults to true.
alarm-actions set A set of actions to be executed when this Metric Alarm transitions to the ALARM state. Each action is a resource ARN.
description A description for the Metric Alarm.
comparison-operator The operation to use when comparing using threshold and statistics. Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold or LessThanOrEqualToThreshold.
datapoints-to-alarm Number of data points to breach to trigger this Metric Alarm. Minimum allowed value is 1.
dimensions map Key Value pair to specify what the metric is as specified in the metric name.
evaluate-low-sample-count-percentile This value indicates if less data points are present to evaluate a trigger, should it ignore or evaluate. Setting ‘ignore’ would ignore the data at that point. Valid values are evaluate or ignore.
evaluation-periods The number of period over which the data point’s are evaluated. Minimum allowed value is 1.
extended-statistic The percentile statistic for the metric specified in MetricName.0`` and p100.
insufficient-data-actions set A set of actions to execute when this Metric Alarm transitions to the INSUFFICIENT_DATA state. ach action is a resource ARN.
metric-name The name of the metric associated with the Metric Alarm. Required if ‘metric’ not set. See AWS Services That Publish CloudWatch Metrics.
namespace The namespace associated with the metric specified in ‘metric-name’ provided. Required if ‘metric’ not set.
ok-actions set A set of actions to execute when this Metric Alarm transitions to the OK state. ach action is a resource ARN.
period The length, in seconds, used each time the metric specified in ‘metric-name’ is evaluated. Required if ‘metric’ not set.
statistic The namespace associated with the metric specified in ‘metric-name’ provided. Can only be set if ‘metric’ not set. Valid values are SampleCount, Average, Sum, Minimum or Maximum.
threshold The value against which the specified statistic is compared.
treat-missing-data How the metric handles missing data. Defaults to ‘missing’. Valid values are breaching, notBreaching, ignore or missing.
unit The unit of measure for the statistic.
metric set A set of metric queries. If set ‘metric-name’, ‘namespace’, ‘period’ and ‘dimensions’ cannot be set.

Outputs

Attribute Description
arn The arn for the Metric Alarm.
state The state of the Metric Alarm.