Feature request: support accessing Lambda context in record handler #1607
Labels
batch
This item relates to the Batch Processing Utility
completed
This item is complete and has been merged/shipped
feature-request
This item refers to a feature request for an existing or new utility
Milestone
Use Case
In the Python version of Powertools for AWS, when using Batch Processing and specifying a record handler customers can optionally configure the utility to pass the Lambda context to the record handler. This is useful in those cases in which the record handler needs to be aware of info from the context or needs to be able to retrieve the amount of time left before the function times out.
Solution/User Experience
Refer to the implementation described here.
In Python the feature is possible thanks to the existence of keyword arguments, customers can simply specify an argument named
lambda_context
in the record handler function and the Batch Processing utility will propagate the context from the function to it. In JS there's no notion of keyword arguments so we'll have to find an alternative solution. Proposals/ideas are welcome.Acceptance criteria
The text was updated successfully, but these errors were encountered: