Skip to content

Commit

Permalink
fix(alias): added support for alias to have multiple filter criteria …
Browse files Browse the repository at this point in the history
…event source mappings, same as lambda function
  • Loading branch information
Alexandra Boarna authored and Alexandra Boarna committed Jun 18, 2024
1 parent 3aa5b7e commit 8ebe70f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/alias/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ resource "aws_lambda_event_source_mapping" "this" {
for_each = try(each.value.filter_criteria, null) != null ? [true] : []

content {
filter {
pattern = try(each.value["filter_criteria"].pattern, null)
dynamic "filter" {
for_each = try(flatten([each.value.filter_criteria]), [])

content {
pattern = try(filter.value.pattern, null)
}
}
}
}
Expand Down

0 comments on commit 8ebe70f

Please sign in to comment.