From f6265fae9777bc78001a78bd79dc9720af622fbf Mon Sep 17 00:00:00 2001 From: Ilmari Vacklin Date: Wed, 16 Oct 2024 10:05:53 +0300 Subject: [PATCH] fix: route53 alarm threshold is inverted # Conflicts: # infra/lib/route53-health-checks-stack.ts --- infra/lib/route53-health-checks-stack.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/infra/lib/route53-health-checks-stack.ts b/infra/lib/route53-health-checks-stack.ts index 250c9efd..809c3faa 100644 --- a/infra/lib/route53-health-checks-stack.ts +++ b/infra/lib/route53-health-checks-stack.ts @@ -1,5 +1,5 @@ import { Stack, StackProps } from "aws-cdk-lib" -import { Metric } from "aws-cdk-lib/aws-cloudwatch" +import { ComparisonOperator, Metric } from "aws-cdk-lib/aws-cloudwatch" import { SnsAction } from "aws-cdk-lib/aws-cloudwatch-actions" import { CfnHealthCheck } from "aws-cdk-lib/aws-route53" import { ITopic } from "aws-cdk-lib/aws-sns" @@ -29,7 +29,8 @@ export class Route53HealthChecksStack extends Stack { }, }) .createAlarm(this, "HealthCheckAlarm", { - threshold: 1, + comparisonOperator: ComparisonOperator.LESS_THAN_THRESHOLD, + threshold: 1, // 1 is healthy, 0 is unhealthy evaluationPeriods: 1, }) .addAlarmAction(new SnsAction(props.alarmsSnsTopic))