Created
November 25, 2023 23:39
-
-
Save yvonnel098/a4ee25dca33e646607850a161a897488 to your computer and use it in GitHub Desktop.
AWS Cloudformation Example of Event Source Mapping Filter from DynamoDB Table Kinesis Stream by Keyword
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EventSourceMapping: | |
Type: AWS::Lambda::EventSourceMapping | |
DependsOn: | |
- DLQ | |
- DestinationLambdaLogicalFunctionName | |
Properties: | |
EventSourceArn: Stream.Arn | |
StartingPosition: "TRIM_HORIZON" | |
FilterCriteria: | |
Filters: | |
- Pattern: "{\"dynamodb\":{\"NewImage\":{\"DataId\":{\"SomeText\"}}}}" | |
DestinationConfig: | |
OnFailure: | |
Destination: !GetAtt DLQ.arn | |
MaximumRetryAttempts: 3 | |
BisectBatchOnFucntionError: true | |
BatchSize: batchSize | |
MaximumBatchingWindowInSeconds: seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example cloudformation code for a Kinesis Stream Event Source to Lambda, filtering data by key word. Failure to invoke lambda will land the data in DLQ. Must adjust BatchSize and Batching Window base on data volumn.
Here's link to the full AWS documentation.