aws-cdk-lib.aws_lightsail.CfnAlarmProps

interface CfnAlarmProps

LanguageType name
.NETAmazon.CDK.AWS.Lightsail.CfnAlarmProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslightsail#CfnAlarmProps
Javasoftware.amazon.awscdk.services.lightsail.CfnAlarmProps
Pythonaws_cdk.aws_lightsail.CfnAlarmProps
TypeScript aws-cdk-lib » aws_lightsail » CfnAlarmProps

Properties for defining a CfnAlarm.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cfnAlarmProps: lightsail.CfnAlarmProps = {
  alarmName: 'alarmName',
  comparisonOperator: 'comparisonOperator',
  evaluationPeriods: 123,
  metricName: 'metricName',
  monitoredResourceName: 'monitoredResourceName',
  threshold: 123,

  // the properties below are optional
  contactProtocols: ['contactProtocols'],
  datapointsToAlarm: 123,
  notificationEnabled: false,
  notificationTriggers: ['notificationTriggers'],
  treatMissingData: 'treatMissingData',
};

Properties

NameTypeDescription
alarmNamestringThe name of the alarm.
comparisonOperatorstringThe arithmetic operation to use when comparing the specified statistic and threshold.
evaluationPeriodsnumberThe number of periods over which data is compared to the specified threshold.
metricNamestringThe name of the metric associated with the alarm.
monitoredResourceNamestringThe name of the Lightsail resource that the alarm monitors.
thresholdnumberThe value against which the specified statistic is compared.
contactProtocols?string[]The contact protocols for the alarm, such as Email , SMS (text messaging), or both.
datapointsToAlarm?numberThe number of data points within the evaluation periods that must be breaching to cause the alarm to go to the ALARM state.
notificationEnabled?boolean | IResolvableA Boolean value indicating whether the alarm is enabled.
notificationTriggers?string[]The alarm states that trigger a notification.
treatMissingData?stringSpecifies how the alarm handles missing data points.

alarmName

Type: string

The name of the alarm.


comparisonOperator

Type: string

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


evaluationPeriods

Type: number

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


metricName

Type: string

The name of the metric associated with the alarm.


monitoredResourceName

Type: string

The name of the Lightsail resource that the alarm monitors.


threshold

Type: number

The value against which the specified statistic is compared.


contactProtocols?

Type: string[] (optional)

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

Allowed Values : Email | SMS


datapointsToAlarm?

Type: number (optional)

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


notificationEnabled?

Type: boolean | IResolvable (optional)

A Boolean value indicating whether the alarm is enabled.


notificationTriggers?

Type: string[] (optional)

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


treatMissingData?

Type: string (optional)

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.