Class DynamoDBPersistenceStore
DynamoDB version of the BasePersistenceStore. Will store idempotency data in DynamoDB.
Implements
Inherited Members
Namespace: AWS.Lambda.Powertools.Idempotency.Persistence
Assembly: AWS.Lambda.Powertools.Idempotency.dll
Syntax
public class DynamoDBPersistenceStore : BasePersistenceStore, IPersistenceStore
Methods
DeleteRecord(string)
Remove item from persistence store
Declaration
public override Task DeleteRecord(string idempotencyKey)
Parameters
Type | Name | Description |
---|---|---|
string | idempotencyKey | idempotencyKey the key of the record |
Returns
Type | Description |
---|---|
Task |
Overrides
GetRecord(string)
Retrieve item from persistence store using idempotency key and return it as a DataRecord instance.
Declaration
public override Task<DataRecord> GetRecord(string idempotencyKey)
Parameters
Type | Name | Description |
---|---|---|
string | idempotencyKey | idempotencyKey the key of the record |
Returns
Type | Description |
---|---|
Task<DataRecord> | DataRecord representation of existing record found in persistence store |
Overrides
Exceptions
Type | Condition |
---|---|
IdempotencyItemNotFoundException | Exception thrown if no record exists in persistence store with the idempotency key |
PutRecord(DataRecord, DateTimeOffset)
Add a DataRecord to persistence store if it does not already exist with that key. Stores the given idempotency record in the DDB store. If there is an existing record that has expired - either due to the cache expiry or due to the in_progress_expiry - the record will be overwritten and the idempotent operation can continue. Note: This method writes only expiry and status information - not the results of the operation itself.
Declaration
public override Task PutRecord(DataRecord record, DateTimeOffset now)
Parameters
Type | Name | Description |
---|---|---|
DataRecord | record | record DataRecord instance |
DateTimeOffset | now |
Returns
Type | Description |
---|---|
Task |
Overrides
Exceptions
Type | Condition |
---|---|
IdempotencyItemAlreadyExistsException | if a non-expired entry already exists. |
UpdateRecord(DataRecord)
Update item in persistence store
Declaration
public override Task UpdateRecord(DataRecord record)
Parameters
Type | Name | Description |
---|---|---|
DataRecord | record | DataRecord instance |
Returns
Type | Description |
---|---|
Task |