You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within your `record_handler` function, you might need access to the Lambda context to determine how much time you have left before your function times out.
839
+
840
+
We can automatically inject the [Lambda context](https://docs.aws.amazon.com/lambda/latest/dg/python-context.html){target="_blank"} into your `record_handler` if your function signature has a parameter named `lambda_context`. When using a context manager, you also need to pass the Lambda context object like in the example below.
841
+
842
+
=== "As a decorator"
843
+
844
+
```python hl_lines="15"
845
+
from typing import Optional
846
+
847
+
from aws_lambda_powertools import Logger, Tracer
848
+
from aws_lambda_powertools.utilities.batch import (BatchProcessor, EventType,
849
+
batch_processor)
850
+
from aws_lambda_powertools.utilities.data_classes.sqs_event import SQSRecord
851
+
from aws_lambda_powertools.utilities.typing import LambdaContext
0 commit comments