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" {
31
31
event_source_arn = aws_dynamodb_table.this.stream_arn
32
32
starting_position = " LATEST"
33
33
destination_arn_on_failure = aws_sqs_queue.failure.arn
34
+ filter_criteria = {
35
+ pattern = jsonencode ({
36
+ eventName : [" INSERT" ]
37
+ })
38
+ }
34
39
}
35
40
kinesis = {
36
41
event_source_arn = aws_kinesis_stream.this.arn
37
42
starting_position = " LATEST"
43
+ filter_criteria = {
44
+ pattern = jsonencode ({
45
+ data : {
46
+ Temperature : [{ numeric : [" >" , 0 , " <=" , 100 ] }]
47
+ Location : [" Oslo" ]
48
+ }
49
+ })
50
+ }
38
51
}
39
52
mq = {
40
53
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" {
256
256
uri = source_access_configuration. value [" uri" ]
257
257
}
258
258
}
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
+ }
259
269
}
You can’t perform that action at this time.
0 commit comments