-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-lambda: logRetention deprecation messages for Provider or CustomResource (most likely) #28806
Comments
I think there is a fix in the works at #28783 |
…gGroup` (#28783) In #28737 we have deprecated `logRetention` in favor of `logGroup`. Some custom resources have made the `logRetention` property part of their own API and are now emitting deprecation warnings with no way forward to resolve them. So we are now also deprecating `logRetention` for any custom resources. Migrating log groups for custom resource would follow the same steps as outline in #28737. Given that custom resource logging is for debugging purposes and there are no guarantees about the output format, it should be possible to simply replace `logRetention` with a simple `logGroup` in most cases: ```ts const awsCustom1 = new cr.AwsCustomResource(this, 'API1', { // Replace this logRetention: logs.RetentionDays.ONE_WEEK, // with logGroup: new logs.LogGroup(this, 'AwsCustomResourceLogs', { retention: logs.RetentionDays.ONE_WEEK, }), }); ``` Fixes #28806 Fixes #28809 Related to #28737 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
@mrgrain Any solution or workaround to this yet? I am still getting this error. Specific issue is given #28809 I didn't understand what to do based on [WARNING] aws-cdk-lib.aws_lambda.FunctionOptions#logRetention is deprecated. In AWS CDK code, you can access the log group name directly from the LogGroup construct: declare const myLogGroup: logs.LogGroup; |
Describe the bug
After the deprecation of logRetention, we migrated the usage to logGroup. Sadly our logs are still full of deprecation warnings. After some debugging our assumption is that this is related to either the Provider or CustomResource construct. We tried to remove logRetention from Provider, but this does not help and there is no logGroup method available. So I assume somewhere under the hood you guys also still use logRetention.
Expected Behavior
AWS CDK internally also does not use logRetention anymore, or at least the warnings are not shown in this case.
Current Behavior
Logs are full of:
Reproduction Steps
As said I did not check your code, but the assumption is when using Provider in combination with CustomResource creates this issue.
Possible Solution
Additional Information/Context
No response
CDK CLI Version
2.122.0
Framework Version
No response
Node.js Version
20.11.0
OS
OSX
Language
Java
Language Version
Java 17
Other information
No response
The text was updated successfully, but these errors were encountered: