Closed
Description
Use case
When making their functions idempotent, customers should be able to enable payload validation. This validation is performed any time a record is retrieved from the persistence layer and it compares the hash of the data passed during call and the record previously stored.
Payload validation supports JMESPath selectors and is enabled whenever validationKeyJmesPath
is passed to IdempotencyConfig
during initialization.
Solution/User Experience
import { IdempotencyConfig } from '@aws-lambda-powertools/idempotency';
const config = new IdempotencyConfig({
validationKeyJmesPath: 'foo', // This will select the `foo` field in the data
});
References:
- https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/aws_lambda_powertools/utilities/idempotency/persistence/base.py#L154-L155
- https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/aws_lambda_powertools/utilities/idempotency/persistence/base.py#L234-L254
- https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/aws_lambda_powertools/utilities/idempotency/persistence/base.py#L428
Alternative solutions
No response
Acknowledgment
- This feature request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Python, Java