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
Copy file name to clipboardExpand all lines: docs/utilities/batch.md
+53-3
Original file line number
Diff line number
Diff line change
@@ -143,10 +143,13 @@ Use `PartialSQSProcessor` context manager to access a list of all return values
143
143
return result
144
144
```
145
145
146
-
### Passing custom boto3 config
146
+
### Customizing boto configuration
147
147
148
-
If you need to pass custom configuration such as region to the SDK, you can pass your own [botocore config object](https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html) to
149
-
the `sqs_batch_processor` decorator:
148
+
The **`config`** and **`boto3_session`** parameters enable you to pass in a custom [botocore config object](https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html)
149
+
or a custom [boto3 session](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html) when using the `sqs_batch_processor`
150
+
decorator or `PartialSQSProcessor` class.
151
+
152
+
> Custom config example
150
153
151
154
=== "Decorator"
152
155
@@ -193,6 +196,53 @@ the `sqs_batch_processor` decorator:
193
196
return result
194
197
```
195
198
199
+
> Custom boto3 session example
200
+
201
+
=== "Decorator"
202
+
203
+
```python hl_lines="4 12"
204
+
from aws_lambda_powertools.utilities.batch import sqs_batch_processor
205
+
from botocore.config import Config
206
+
207
+
session = boto3.session.Session()
208
+
209
+
def record_handler(record):
210
+
# This will be called for each individual message from a batch
211
+
# It should raise an exception if the message was not processed successfully
If you want to disable the default behavior where `SQSBatchProcessingError` is raised if there are any errors, you can pass the `suppress_exception` boolean argument.
Copy file name to clipboardExpand all lines: docs/utilities/idempotency.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -548,7 +548,7 @@ This means that we will raise **`IdempotencyKeyError`** if the evaluation of **`
548
548
549
549
### Customizing boto configuration
550
550
551
-
You can provide a custom boto configuration via **`boto_config`**, or an existing boto session via **`boto3_session`** parameters, when constructing the persistence store.
551
+
The **`boto_config`** and **`boto3_session`** parameters enable you to pass in a custom [botocore config object](https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html) or a custom [boto3 session](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html) when constructing the persistence store.
Copy file name to clipboardExpand all lines: docs/utilities/parameters.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -505,7 +505,7 @@ Here is the mapping between this utility's functions and methods and the underly
505
505
506
506
### Customizing boto configuration
507
507
508
-
You can provide a custom boto configuration via **`config`**, or use a custom boto session via **`boto3_session`** parameters, when constructing any of the built-in provider classes.
508
+
The **`config`** and **`boto3_session`** parameters enable you to pass in a custom [botocore config object](https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html) or a custom [boto3 session](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html) when constructing any of the built-in provider classes.
0 commit comments