aws-cdk-lib.aws_cloudwatch.ComparisonOperator

enum ComparisonOperator

LanguageType name
.NETAmazon.CDK.AWS.CloudWatch.ComparisonOperator
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#ComparisonOperator
Javasoftware.amazon.awscdk.services.cloudwatch.ComparisonOperator
Pythonaws_cdk.aws_cloudwatch.ComparisonOperator
TypeScript (source)aws-cdk-lib » aws_cloudwatch » ComparisonOperator

Comparison operator for evaluating alarms.

Example

import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';

declare const myHostedZone: route53.HostedZone;
const certificate = new acm.Certificate(this, 'Certificate', {
  domainName: 'hello.example.com',
  validation: acm.CertificateValidation.fromDns(myHostedZone),
});
certificate.metricDaysToExpiry().createAlarm(this, 'Alarm', {
  comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_THRESHOLD,
  evaluationPeriods: 1,
  threshold: 45, // Automatic rotation happens between 60 and 45 days before expiry
});

Members

NameDescription
GREATER_THAN_OR_EQUAL_TO_THRESHOLDSpecified statistic is greater than or equal to the threshold.
GREATER_THAN_THRESHOLDSpecified statistic is strictly greater than the threshold.
LESS_THAN_THRESHOLDSpecified statistic is strictly less than the threshold.
LESS_THAN_OR_EQUAL_TO_THRESHOLDSpecified statistic is less than or equal to the threshold.
LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLDSpecified statistic is lower than or greater than the anomaly model band.
GREATER_THAN_UPPER_THRESHOLDSpecified statistic is greater than the anomaly model band.
LESS_THAN_LOWER_THRESHOLDSpecified statistic is lower than the anomaly model band.

GREATER_THAN_OR_EQUAL_TO_THRESHOLD

Specified statistic is greater than or equal to the threshold.


GREATER_THAN_THRESHOLD

Specified statistic is strictly greater than the threshold.


LESS_THAN_THRESHOLD

Specified statistic is strictly less than the threshold.


LESS_THAN_OR_EQUAL_TO_THRESHOLD

Specified statistic is less than or equal to the threshold.


LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD

Specified statistic is lower than or greater than the anomaly model band.

Used only for alarms based on anomaly detection models


GREATER_THAN_UPPER_THRESHOLD

Specified statistic is greater than the anomaly model band.

Used only for alarms based on anomaly detection models


LESS_THAN_LOWER_THRESHOLD

Specified statistic is lower than the anomaly model band.

Used only for alarms based on anomaly detection models