(custom-resource): Custom Resource provider is using deprecated LogFormat parameter
Describe the bug
Latest version of aws-cdk 2.206.0 has updated the custom resource provider to include a deprecated parameter LogFormat causing synth warnings when performing a cdk synth
Reverting to previous versions of cdk lib stops these warnings
Regression Issue
- [ ] Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
No response
Expected Behavior
CDK synth should not show warnings about deprecated LogFormat
Current Behavior
[WARNING] aws-cdk-lib.aws_lambda.FunctionOptions#logFormat is deprecated.
Use `loggingFormat` as a property instead.
This API will be removed in the next major release.
Reproduction Steps
Create a CDK stack that creates a custom resource
Possible Solution
No response
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
2.206.0
AWS CDK CLI version
2.1020.2
Node.js Version
n/a
OS
Linux
Language
Python
Language Version
No response
Other information
No response
My team is also seeing this.
Hi @mjgoble,
Thank you for reporting this issue! You're right - the Custom Resource provider is still using the deprecated logFormat parameter instead of the new loggingFormat parameter, which is causing the warning messages during synthesis.
The logFormat parameter was deprecated in favor of loggingFormat in PR #28942 (merged in January 2024), but the Custom Resource provider code wasn't updated to use the new parameter.
The fix is straightforward - we need to update the Provider class to use loggingFormat instead of logFormat.
I've confirmed this is a legitimate issue and it should be fixed. I will submit a PR to get it fixed shortly.
The PR essentially will:
- Change
logFormat: lambda.LogFormat.JSONtologgingFormat: lambda.LoggingFormat.JSONin thecreateFunctionmethod - Add tests to verify the fix works correctly
Thanks again for reporting this issue!
@pahud - Do you know when the fix for this is likely to be merged? The cdk synth warnings are causing some of our CI checks to fail
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.