CfnAlarmProps

class aws_cdk.aws_lightsail.CfnAlarmProps(*, alarm_name, comparison_operator, evaluation_periods, metric_name, monitored_resource_name, threshold, contact_protocols=None, datapoints_to_alarm=None, notification_enabled=None, notification_triggers=None, treat_missing_data=None)

Bases: object

Properties for defining a CfnAlarm.

Parameters:
  • alarm_name (str) – The name of the alarm.

  • comparison_operator (str) – The arithmetic operation to use when comparing the specified statistic and threshold.

  • evaluation_periods (Union[int, float]) – The number of periods over which data is compared to the specified threshold.

  • metric_name (str) – The name of the metric associated with the alarm.

  • monitored_resource_name (str) – The name of the Lightsail resource that the alarm monitors.

  • threshold (Union[int, float]) – The value against which the specified statistic is compared.

  • contact_protocols (Optional[Sequence[str]]) – The contact protocols for the alarm, such as Email , SMS (text messaging), or both. Allowed Values : Email | SMS

  • datapoints_to_alarm (Union[int, float, None]) – The number of data points within the evaluation periods that must be breaching to cause the alarm to go to the ALARM state.

  • notification_enabled (Union[bool, IResolvable, None]) – A Boolean value indicating whether the alarm is enabled.

  • notification_triggers (Optional[Sequence[str]]) – The alarm states that trigger a notification. .. epigraph:: To specify the OK and INSUFFICIENT_DATA values, you must also specify ContactProtocols values. Otherwise, the OK and INSUFFICIENT_DATA values will not take effect and the stack will drift. Allowed Values : OK | ALARM | INSUFFICIENT_DATA

  • treat_missing_data (Optional[str]) – Specifies how the alarm handles missing data points. An alarm can treat missing data in the following ways: - breaching - Assumes the missing data is not within the threshold. Missing data counts towards the number of times that the metric is not within the threshold. - notBreaching - Assumes the missing data is within the threshold. Missing data does not count towards the number of times that the metric is not within the threshold. - ignore - Ignores the missing data. Maintains the current alarm state. - missing - Missing data is treated as missing.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cfn_alarm_props = lightsail.CfnAlarmProps(
    alarm_name="alarmName",
    comparison_operator="comparisonOperator",
    evaluation_periods=123,
    metric_name="metricName",
    monitored_resource_name="monitoredResourceName",
    threshold=123,

    # the properties below are optional
    contact_protocols=["contactProtocols"],
    datapoints_to_alarm=123,
    notification_enabled=False,
    notification_triggers=["notificationTriggers"],
    treat_missing_data="treatMissingData"
)

Attributes

alarm_name

The name of the alarm.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-alarmname

comparison_operator

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-comparisonoperator

contact_protocols

The contact protocols for the alarm, such as Email , SMS (text messaging), or both.

Allowed Values : Email | SMS

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-contactprotocols

datapoints_to_alarm

The number of data points within the evaluation periods that must be breaching to cause the alarm to go to the ALARM state.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-datapointstoalarm

evaluation_periods

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-evaluationperiods

metric_name

The name of the metric associated with the alarm.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-metricname

monitored_resource_name

The name of the Lightsail resource that the alarm monitors.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-monitoredresourcename

notification_enabled

A Boolean value indicating whether the alarm is enabled.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-notificationenabled

notification_triggers

The alarm states that trigger a notification.

To specify the OK and INSUFFICIENT_DATA values, you must also specify ContactProtocols values. Otherwise, the OK and INSUFFICIENT_DATA values will not take effect and the stack will drift.

Allowed Values : OK | ALARM | INSUFFICIENT_DATA

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-notificationtriggers

threshold

The value against which the specified statistic is compared.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-threshold

treat_missing_data

Specifies how the alarm handles missing data points.

An alarm can treat missing data in the following ways:

  • breaching - Assumes the missing data is not within the threshold. Missing data counts towards the number of times that the metric is not within the threshold.

  • notBreaching - Assumes the missing data is within the threshold. Missing data does not count towards the number of times that the metric is not within the threshold.

  • ignore - Ignores the missing data. Maintains the current alarm state.

  • missing - Missing data is treated as missing.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-alarm.html#cfn-lightsail-alarm-treatmissingdata