aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

(custom-resource): Custom Resource provider is using deprecated LogFormat parameter

Open mjgoble opened this issue 1 year ago • 4 comments

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

mjgoble avatar Jul 16 '25 22:07 mjgoble

My team is also seeing this.

tdq132 avatar Jul 17 '25 02:07 tdq132

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:

  1. Change logFormat: lambda.LogFormat.JSON to loggingFormat: lambda.LoggingFormat.JSON in the createFunction method
  2. Add tests to verify the fix works correctly

Thanks again for reporting this issue!

pahud avatar Jul 18 '25 19:07 pahud

@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

mjgoble avatar Jul 24 '25 04:07 mjgoble

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.

github-actions[bot] avatar Jul 29 '25 10:07 github-actions[bot]