-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(idempotent): Include function name in the idempotent key #326
feat(idempotent): Include function name in the idempotent key #326
Conversation
@heitorlessa what do you think of this ? |
Co-authored-by: Joris Conijn <[email protected]>
Co-authored-by: Joris Conijn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!!! Only change here is that we shouldn't add this extra parameter to include function_name, but make it the default.
Because we're in Beta this won't cause any distress, and due to the fact changing a Function name is not possible from an API perspective - IaC triggers a replacement instead.
aws_lambda_powertools/utilities/idempotency/persistence/base.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/idempotency/persistence/base.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the changes @michaelbrewer, as always ;)
Added a note to update docs to emphasize you can now use a single DDB table to store idempotence state if you wish
Issue #, if available:
#318
Description of changes:
Prefix the
hashed_idempotency_key
with the context function name:f"{context.function_name}#{self._generate_hash(data)}"
HOWEVER: You MIGHT get edge cases where the function name has been changed while keeping an existing datastore
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.