File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
examples/event-source-mapping Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,23 @@ module "lambda_function" {
3131 event_source_arn = aws_dynamodb_table.this.stream_arn
3232 starting_position = " LATEST"
3333 destination_arn_on_failure = aws_sqs_queue.failure.arn
34+ filter_criteria = {
35+ pattern = jsonencode ({
36+ eventName : [" INSERT" ]
37+ })
38+ }
3439 }
3540 kinesis = {
3641 event_source_arn = aws_kinesis_stream.this.arn
3742 starting_position = " LATEST"
43+ filter_criteria = {
44+ pattern = jsonencode ({
45+ data : {
46+ Temperature : [{ numeric : [" >" , 0 , " <=" , 100 ] }]
47+ Location : [" Oslo" ]
48+ }
49+ })
50+ }
3851 }
3952 mq = {
4053 event_source_arn = aws_mq_broker.this.arn
Original file line number Diff line number Diff line change @@ -256,4 +256,14 @@ resource "aws_lambda_event_source_mapping" "this" {
256256 uri = source_access_configuration. value [" uri" ]
257257 }
258258 }
259+
260+ dynamic "filter_criteria" {
261+ for_each = lookup (each. value , " filter_criteria" , null ) != null ? [true ] : []
262+
263+ content {
264+ filter {
265+ pattern = lookup (filter_criteria, " pattern" , null )
266+ }
267+ }
268+ }
259269}
You can’t perform that action at this time.
0 commit comments