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
**validation_key_attr** | | `validation` | Hashed representation of the parts of the event used for validation
334
+
**sort_key_attr** | | | Sort key of the table (if table is configured with a sort key).
335
+
**static_pk_value** | | `idempotency#{LAMBDA_FUNCTION_NAME}` | Static value to use as the partition key. Only used when **sort_key_attr** is set.
334
336
335
337
## Advanced
336
338
@@ -590,6 +592,36 @@ The **`boto_config`** and **`boto3_session`** parameters enable you to pass in a
590
592
...
591
593
```
592
594
595
+
### Using a DynamoDB table with a composite primary key
596
+
597
+
If you wish to use this utility with a DynamoDB table that is configured with a composite primary key (uses both partition key and sort key), you
598
+
should set the `sort_key_attr` parameter when initializing your persistence layer. When this parameter is set, the partition key value for all idempotency entries
599
+
will be the same, with the idempotency key being saved as the sort key instead of the partition key. You can optionally set a static value for the partition
600
+
key using the `static_pk_value` parameter. If not specified, it will default to `idempotency#{LAMBDA_FUNCTION_NAME}`.
601
+
602
+
=== "MyLambdaFunction"
603
+
604
+
```python hl_lines="5"
605
+
from aws_lambda_powertools.utilities.idempotency import DynamoDBPersistenceLayer, idempotent
0 commit comments