From 2c59b4fe9d1bf49744360ebcee364c7a56c6acc7 Mon Sep 17 00:00:00 2001 From: Malcolm Landon Date: Thu, 1 Sep 2022 09:39:41 +0100 Subject: [PATCH] fix: plat-5879 - correct alarm on lambda worker (#62) * fix: - LambdaWorker - Age alarm on main queue not dlq * fix: - LambdaWorker - Age alarm on main queue not dlq --- lib/lambda-worker/lambda-worker.ts | 2 +- test/infra/lambda-worker/lambda-worker.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lambda-worker/lambda-worker.ts b/lib/lambda-worker/lambda-worker.ts index 304352bd..6937dd0b 100644 --- a/lib/lambda-worker/lambda-worker.ts +++ b/lib/lambda-worker/lambda-worker.ts @@ -159,7 +159,7 @@ export class LambdaWorker extends cdk.Construct { dlqMessagesVisable.addOkAction(alarmAction); // Add an alarm for the age of the oldest message on the LambdaWorkers main trigger queue - const approximateAgeOfOldestMessageMetric = lambdaDLQ + const approximateAgeOfOldestMessageMetric = lambdaQueue .metric("ApproximateAgeOfOldestMessage") .with({ statistic: "average", period: cdk.Duration.minutes(1) }); const queueMessagesAge = new cloudwatch.Alarm( diff --git a/test/infra/lambda-worker/lambda-worker.test.ts b/test/infra/lambda-worker/lambda-worker.test.ts index d93a26c8..82ac1c63 100644 --- a/test/infra/lambda-worker/lambda-worker.test.ts +++ b/test/infra/lambda-worker/lambda-worker.test.ts @@ -183,7 +183,7 @@ describe("LambdaWorker", () => { Name: "QueueName", Value: { "Fn::GetAtt": [ - "MyTestLambdaWorkerMyTestLambdaWorkerdlq27BBFD95", + "MyTestLambdaWorkerMyTestLambdaWorkerqueue01D6E79E", "QueueName", ], }, @@ -619,7 +619,7 @@ describe("LambdaWorker", () => { Name: "QueueName", Value: { "Fn::GetAtt": [ - "MyTestLambdaWorkerMyTestLambdaWorkerdlq27BBFD95", + "MyTestLambdaWorkerMyTestLambdaWorkerqueue01D6E79E", "QueueName", ], },