Closed
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