Config
CLASS | DESCRIPTION |
---|---|
IdempotencyConfig |
|
IdempotencyConfig ¶
IdempotencyConfig(
event_key_jmespath: str = "",
payload_validation_jmespath: str = "",
jmespath_options: dict | None = None,
raise_on_no_idempotency_key: bool = False,
expires_after_seconds: int = 60 * 60,
use_local_cache: bool = False,
local_cache_max_items: int = 256,
hash_function: str = "md5",
lambda_context: LambdaContext | None = None,
response_hook: IdempotentHookFunction | None = None,
)
PARAMETER | DESCRIPTION |
---|---|
event_key_jmespath
|
A jmespath expression to extract the idempotency key from the event record
TYPE:
|
payload_validation_jmespath
|
A jmespath expression to extract the payload to be validated from the event record
TYPE:
|
raise_on_no_idempotency_key
|
Raise exception if no idempotency key was found in the request, by default False
TYPE:
|
expires_after_seconds
|
The number of seconds to wait before a record is expired
TYPE:
|
use_local_cache
|
Whether to locally cache idempotency results, by default False
TYPE:
|
local_cache_max_items
|
Max number of items to store in local cache, by default 1024
TYPE:
|
hash_function
|
Function to use for calculating hashes, by default md5.
TYPE:
|
lambda_context
|
Lambda Context containing information about the invocation, function and execution environment.
TYPE:
|
response_hook
|
Hook function to be called when an idempotent response is returned from the idempotent store.
TYPE:
|
METHOD | DESCRIPTION |
---|---|
register_lambda_context |
Captures the Lambda context, to calculate the remaining time before the invocation times out |
Source code in aws_lambda_powertools/utilities/idempotency/config.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
register_lambda_context ¶
register_lambda_context(lambda_context: LambdaContext)
Captures the Lambda context, to calculate the remaining time before the invocation times out
Source code in aws_lambda_powertools/utilities/idempotency/config.py
59 60 61 |
|