Skip to content

Commit

Permalink
fix(sdk): logformat used in awscdk lambda functions is deprecated (#7228
Browse files Browse the repository at this point in the history
)

The LogFormat used in AWS CDK for Lambda Functions is deprecated, and is being changed to LoggingFormat.

## Checklist

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [ ] Tests added (always)
- [ ] Docs updated (only required for features)
- [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
  • Loading branch information
marciocadev authored Jan 2, 2025
1 parent 76a5895 commit 7aa9d6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions packages/@winglang/platform-awscdk/src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Code,
Runtime,
LayerVersion,
LogFormat,
LoggingFormat,
} from "aws-cdk-lib/aws-lambda";
import { LogGroup, RetentionDays } from "aws-cdk-lib/aws-logs";
import { Asset } from "aws-cdk-lib/aws-s3-assets";
Expand Down Expand Up @@ -56,8 +56,7 @@ export function addPolicyStatements(
*/
export class Function
extends cloud.Function
implements IAwsCdkFunction, IAwsFunction
{
implements IAwsCdkFunction, IAwsFunction {
/** @internal */
public static _toInflightType(): string {
return InflightClient.forType(
Expand Down Expand Up @@ -180,8 +179,8 @@ export class Function
props.logRetentionDays === undefined
? 30
: props.logRetentionDays < 0
? RetentionDays.INFINITE // Negative value means Infinite retention
: props.logRetentionDays;
? RetentionDays.INFINITE // Negative value means Infinite retention
: props.logRetentionDays;

const logs = new LogGroup(this, "LogGroup", {
retention: logRetentionDays,
Expand All @@ -201,7 +200,7 @@ export class Function
memorySize: props.memory ?? 1024,
architecture: Architecture.ARM_64,
logGroup: logs,
logFormat: LogFormat.JSON,
logFormat: LoggingFormat.JSON,
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@winglang/sdk/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/vscode-wing/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/wing-api-checker/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7aa9d6a

Please sign in to comment.