Skip to content

Instantly share code, notes, and snippets.

@yvonnel098
Created November 25, 2023 23:39
Show Gist options
  • Save yvonnel098/a4ee25dca33e646607850a161a897488 to your computer and use it in GitHub Desktop.
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
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
@yvonnel098
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment