feat: Add DynamoDB Streams CDC pattern with Lambda durable functions … - #3188
feat: Add DynamoDB Streams CDC pattern with Lambda durable functions …#3188awsTest1992 wants to merge 1 commit into
Conversation
ellisms
left a comment
There was a problem hiding this comment.
Thanks for the submission, @awsTest1992 . Requesting a few changes.
| - Effect: Allow | ||
| Action: | ||
| - lambda:InvokeFunction | ||
| Resource: !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-processor*" |
There was a problem hiding this comment.
Recommend changing resource statement to:
Resource: - !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-processor" - !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-processor:*"
| import uuid | ||
| import logging | ||
| from datetime import datetime, timezone | ||
| from decimal import Decimal |
There was a problem hiding this comment.
This looks like an unused import. Remove if not needed.
| missing = [f for f in required_fields if f not in new_image] | ||
|
|
||
| if missing: | ||
| raise UnrecoverableInvocationError( |
There was a problem hiding this comment.
I think you need to import this
| KeyType: HASH | ||
|
|
||
| # Durable Function — processes stream records with checkpoints | ||
| StreamProcessorFunction: |
There was a problem hiding this comment.
Recommend explicitly creating the associated CloudWatch logs group so that there is a retention policy, and the group is removed during stack destroy.
| from aws_durable_execution_sdk_python.context import DurableContext, StepContext, durable_step | ||
| from aws_durable_execution_sdk_python.execution import durable_execution | ||
|
|
||
| logger = logging.getLogger() |
There was a problem hiding this comment.
Recommend using the context.logger from the durable function sdk so that the logger is replay-aware.
…(Python)
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.