From 448b441379209b21fe12311e7a7ff6383460b2fb Mon Sep 17 00:00:00 2001 From: Parker Scanlon <69879391+scanlonp@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:53:34 -0700 Subject: [PATCH] chore(lambda): match enum value to property (#30472) Looks like we are comparing `LogFormat` to the `LoggingFormat` enum. This is not technically a problem for us because `LogFormat` is a string. We deprecated it and created `LoggingFormat` to enforce the enum. This conditional works because all the enums collapse to strings, but it is best if we sync up the properties with their correct enums. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-lambda/lib/function.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-lambda/lib/function.ts b/packages/aws-cdk-lib/aws-lambda/lib/function.ts index 32e477f81f86b..45c67d9ea3d4b 100644 --- a/packages/aws-cdk-lib/aws-lambda/lib/function.ts +++ b/packages/aws-cdk-lib/aws-lambda/lib/function.ts @@ -1179,7 +1179,7 @@ export class Function extends FunctionBase { } if (props.applicationLogLevel || props.applicationLogLevelV2 || props.systemLogLevel || props.systemLogLevelV2) { - if (props.logFormat !== LoggingFormat.JSON && props.loggingFormat === undefined) { + if (props.logFormat !== LogFormat.JSON && props.loggingFormat === undefined) { throw new Error(`To use ApplicationLogLevel and/or SystemLogLevel you must set LogFormat to '${LogFormat.JSON}', got '${props.logFormat}'.`); }