Skip to content

Commit 89b1e5f

Browse files
author
Tom McCarthy
committed
docs: allow boto3_session parameter to be passed through decorator
1 parent 199f2a1 commit 89b1e5f

File tree

1 file changed

+6
-1
lines changed
  • aws_lambda_powertools/utilities/batch

1 file changed

+6
-1
lines changed

Diff for: aws_lambda_powertools/utilities/batch/sqs.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def sqs_batch_processor(
150150
record_handler: Callable,
151151
config: Optional[Config] = None,
152152
suppress_exception: bool = False,
153+
boto3_session: Optional[boto3.session.Session] = None,
153154
):
154155
"""
155156
Middleware to handle SQS batch event processing
@@ -168,6 +169,8 @@ def sqs_batch_processor(
168169
botocore config object
169170
suppress_exception: bool, optional
170171
Supress exception raised if any messages fail processing, by default False
172+
boto3_session : boto3.session.Session, optional
173+
Boto3 session to use for AWS API communication
171174
172175
Examples
173176
--------
@@ -188,7 +191,9 @@ def sqs_batch_processor(
188191
189192
"""
190193
config = config or Config()
191-
processor = PartialSQSProcessor(config=config, suppress_exception=suppress_exception)
194+
session = boto3_session or boto3.session.Session()
195+
196+
processor = PartialSQSProcessor(config=config, suppress_exception=suppress_exception, boto3_session=session)
192197

193198
records = event["Records"]
194199

0 commit comments

Comments
 (0)