[Amplify JS] add logging configuration options for functions#8428
Draft
nsteffens wants to merge 1 commit intoaws-amplify:mainfrom
Draft
[Amplify JS] add logging configuration options for functions#8428nsteffens wants to merge 1 commit intoaws-amplify:mainfrom
nsteffens wants to merge 1 commit intoaws-amplify:mainfrom
Conversation
4 tasks
ShadowCat567
pushed a commit
to aws-amplify/amplify-backend
that referenced
this pull request
Jan 5, 2026
…perties (#2968) ## Problem <!-- Describe the issue this PR is solving --> **Issue number, if available:** #2965 ## Changes - Refactored `logging_options_parser.ts` to use modern, non-deprecated AWS CDK properties for Lambda logging - Replaced the deprecated `logRetention` property with a dedicated `LogGroup` resource - Updated `applicationLogLevelV2` and `loggingFormat` usage to follow AWS CDK best practices - Updated tests to verify the new implementation works correctly - Maintained backward compatibility for end users (no API changes) - Updated documentation to have logging field documented in general. See PR aws-amplify/docs#8428 ### Why AWS CDK marked several properties in `NodejsFunction` as deprecated: - [`logRetention`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs.NodejsFunction.html#logretentionspan-classapi-icon-api-icon-deprecated-titlethis-api-element-is-deprecated-its-use-is-not-recommended%EF%B8%8Fspan) - Recommended to use a dedicated `LogGroup` resource - Creating a `LogGroup` automatically to be used if logRetention is set. Will fallback to default `NodeJsFunction` when `undefined`. This change ensures that Lambda functions continue to work properly with future AWS CDK versions. ## Testing - Updated and extended unit tests to verify the new implementation - Manually verified that logs are correctly configured with the proper retention settings - Ensured backward compatibility for user-facing APIs **Corresponding docs PR, if applicable:** TBD ## Validation Have ran tests locally. Should be tested against an AWS account before going live. ## Checklist - [x] If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change. - [x] If this PR requires a change to the [Project Architecture README](../PROJECT_ARCHITECTURE.md), I have included that update in this PR. - [x] If this PR requires a docs update, I have linked to that docs PR above. - [ ] If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the `run-e2e` label set. _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license._ --------- Co-authored-by: Nico Steffens <nico.steffens@mercedes-benz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
This adds documentation for the logging configuration options of a function that's added through Amplify.
Related GitHub issue #, if available:
aws-amplify/amplify-backend#2965
Instructions
If this PR should not be merged upon approval for any reason, please submit as a DRAFT
Which product(s) are affected by this PR (if applicable)?
Which platform(s) are affected by this PR (if applicable)?
Please add the product(s)/platform(s) affected to the PR title
Checks
Does this PR conform to the styleguide?
Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.
Are any files being deleted with this PR? If so, have the needed redirects been created?
Are all links in MDX files using the MDX link syntax rather than HTML link syntax?
ref: MDX:
[link](https://docs.amplify.aws/)HTML:
<a href="https://docs.amplify.aws/">link</a>When this PR is ready to merge, please check the box below
This shall be merged in sync with aws-amplify/amplify-backend#2965.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.