Protected
_deleteProtected
_getProtected
_putProtected
_updateInitialize the base persistence layer from the configuration settings
configuration object for the persistence layer
Retrieves idempotency key for the provided data and fetches data for that key from the persistence store
the data payload that will be hashed to create the hash portion of the idempotency key
Validates an existing record against the data payload being processed.
If the payload does not match the stored record, an IdempotencyValidationError
error is thrown.
Whenever a record is retrieved from the persistence layer, it should be validated against the data payload being processed. This is to ensure that the data payload being processed is the same as the one that was used to create the record in the first place.
The record is also saved to the local cache if local caching is enabled.
Saves a record indicating that the function's execution is currently in progress
the data payload that will be hashed to create the hash portion of the idempotency key
Optional
remainingTimeInMillis: numberthe remaining time left in the lambda execution context
Saves a record of the function completing successfully. This will create a record with a COMPLETED status and will save the result of the completed function in the idempotency record.
the data payload that will be hashed to create the hash portion of the idempotency key
the result of the successfully completed function
Generated using TypeDoc
DynamoDB persistence layer for idempotency records.
This class uses the AWS SDK for JavaScript v3 to write and read idempotency records from DynamoDB.
There are various options to configure the persistence layer, such as the table name, the key attribute, the status attribute, etc.
With default configuration you don't need to create the client beforehand, the persistence layer will create it for you. You can also bring your own AWS SDK V3 client, or configure the client with the
clientConfig
option.See the Idempotency documentation for more details on the IAM permissions and DynamoDB table configuration.
Example
See
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-dynamodb/index.html
Implements