-
Notifications
You must be signed in to change notification settings - Fork 4.5k
aws-lambda: Log format option is not typed #28114
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
Describe the bug
The logFormat option in the FunctionOptions interface is untyped, meaning that it does not accept the LogFormat enum.
See line 469 of https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda/lib/function.ts.
It has also been mentioned in #28039 (comment).
Expected Behavior
It should accept one of the LogFormat enum options.
Current Behavior
It doesn't accept the LogFormat enum so you have to specify a string "JSON" or "TEXT", which is not type-safe.
Reproduction Steps
N/A
Possible Solution
It should be typed as
readonly logFormat?: LogFormat;
Additional Information/Context
No response
CDK CLI Version
2.110.1
Framework Version
No response
Node.js Version
20.9.0
OS
MacOS
Language
Python
Language Version
3.11.2
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2