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
* Use function wrapper to make your function idempotent.
47
+
* Function wrapper to make any function idempotent.
48
+
*
49
+
* The `makeIdempotent` function is a higher-order function that takes another function and returns a new version of that function with idempotency behavior.
50
+
* This means that if the function is called multiple times with the same input, it will return the same result without re-executing the original function logic.
51
+
*
52
+
* By default, the entire first argument is hashed to create the idempotency key. You can customize this behavior:
53
+
* - Use {@link IdempotencyConfig.eventKeyJmesPath | `eventKeyJmesPath`} to hash only a subset of the payload
54
+
* - Use {@link ItempotentFunctionOptions.dataIndexArgument | `dataIndexArgument`} to hash a different function argument
55
+
*
56
+
*
57
+
* **Using a subset of the payload**
58
+
*
48
59
* @example
49
-
* ```ts
50
-
* // this is your processing function with an example record { transactionId: '123', foo: 'bar' }
51
-
* const processRecord = (record: Record<string, unknown>): any => {
52
-
* // you custom processing logic
60
+
* ```typescript
61
+
* import { makeIdempotent, IdempotencyConfig } from '@aws-lambda-powertools/idempotency';
62
+
* import { DynamoDBPersistenceLayer } from '@aws-lambda-powertools/idempotency/dynamodb';
0 commit comments