enum AlarmState
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudWatch.AlarmState |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#AlarmState |
Java | software.amazon.awscdk.services.cloudwatch.AlarmState |
Python | aws_cdk.aws_cloudwatch.AlarmState |
TypeScript (source) | aws-cdk-lib » aws_cloudwatch » AlarmState |
Enumeration indicates state of Alarm used in building Alarm Rule.
Example
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
const metric = new cloudwatch.Metric({
namespace: 'MyNamespace',
metricName: 'MyMetric',
dimensionsMap: { MyDimension: 'MyDimensionValue' },
});
const alarm = new cloudwatch.Alarm(this, 'MyAlarm', {
metric: metric,
threshold: 100,
evaluationPeriods: 3,
datapointsToAlarm: 2,
});
const topicRule = new iot.TopicRule(this, 'TopicRule', {
sql: iot.IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
actions: [
new actions.CloudWatchSetAlarmStateAction(alarm, {
reason: 'AWS Iot Rule action is triggered',
alarmStateToSet: cloudwatch.AlarmState.ALARM,
}),
],
});
Members
| Name | Description |
|---|---|
| ALARM | State indicates resource is in ALARM. |
| OK | State indicates resource is not in ALARM. |
| INSUFFICIENT_DATA | State indicates there is not enough data to determine is resource is in ALARM. |
ALARM
State indicates resource is in ALARM.
OK
State indicates resource is not in ALARM.
INSUFFICIENT_DATA
State indicates there is not enough data to determine is resource is in ALARM.

.NET
Go
Java
Python
TypeScript (