From 649ad35b63f519739354b8bc801dff6c70d66f46 Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Thu, 25 Apr 2024 08:49:29 +0200 Subject: [PATCH] fix: change log level for termination watcher if no match (#3866) Changed log level to debug in case no match. Deploying the lambda multiple times in a single aws account will create unrelated warning logs otherwise. --- lambdas/functions/termination-watcher/src/lambda.test.ts | 1 - .../functions/termination-watcher/src/termination-warning.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lambdas/functions/termination-watcher/src/lambda.test.ts b/lambdas/functions/termination-watcher/src/lambda.test.ts index 0ff4195479..3137232caa 100644 --- a/lambdas/functions/termination-watcher/src/lambda.test.ts +++ b/lambdas/functions/termination-watcher/src/lambda.test.ts @@ -7,7 +7,6 @@ import { interruptionWarning } from './lambda'; import { SpotInterruptionWarning, SpotTerminationDetail } from './types'; jest.mock('./termination-warning'); -//jest.mock('@terraform-aws-github-runner/aws-powertools-util'); process.env.POWERTOOLS_METRICS_NAMESPACE = 'test'; process.env.POWERTOOLS_TRACE_ENABLED = 'true'; diff --git a/lambdas/functions/termination-watcher/src/termination-warning.ts b/lambdas/functions/termination-watcher/src/termination-warning.ts index 4b670bfa79..8a9fad5af6 100644 --- a/lambdas/functions/termination-watcher/src/termination-warning.ts +++ b/lambdas/functions/termination-watcher/src/termination-warning.ts @@ -49,7 +49,7 @@ async function handle(event: SpotInterruptionWarning, con ); } } else { - logger.warn( + logger.debug( `Received spot termination notification warning for instance ${event.detail['instance-id']} but ` + `details are not available or instance not matching the tag fileter (${config.tagFilters}).`, );