Repository navigation
Conversation
|
Thank you for the PR, looks good to me! |
|
Actually, just one thing. Can we update the middy tests here to check the tenant ID: |
|
|
@svozza I've added a test case for Middy to check the scenario where tenant_id is missing. The case where it’s present should already be covered by existing tests. Also, I've fixed an oversight where tenant_id was missing from other context-related tests. I didn't include it in the E2E tests though, as it's an optional field. Please let me know if there are any other test cases or scenarios I should consider. |
|
Good stuff. Don't worry about the E2E test for now, we can add that later. Great work! |



Summary
Changes
This PR adds support for the new AWS Lambda Tenant Isolation feature by including tenantId from the Lambda context as a default property in Logger output.
When a Lambda function is invoked with tenant isolation enabled, the tenantId will automatically be included in all log entries as tenant_id, making it easier to trace and filter logs in multi-tenant environments.
Issue number: closes #4914
Implementation Details
tenantIdtoLambdaFunctionContexttype inlogKeys.tstenant_idtoPowertoolsLambdaContextKeystypeaddContext()method inLogger.tsto extracttenantIdfrom Lambda contextPowertoolsLogFormatter.tsto includetenant_idin formatted outputtenantId)tenantIdin mock contextPlease let me know if there are any points that need correction or if there is anything I should improve before merging.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.