Skip to content

Commit

Permalink
Allow multiple host_headers for LB listeners (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaei authored Jan 8, 2024
2 parents f5c39d8 + aba7270 commit bec45cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,11 @@ resource "aws_lb_listener_rule" "service" {
values = [path_pattern.value]
}
}

dynamic "host_header" {
for_each = condition.value.host_header != null ? [condition.value.host_header] : []
content {
values = [host_header.value]
values = flatten([host_header.value]) # Accept both a string or a list
}
}
dynamic "http_header" {
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ variable "lb_listeners" {

conditions = list(object({
path_pattern = optional(string)
host_header = optional(string)
host_header = optional(any)
http_header = optional(object({
name = string
values = list(string)
Expand Down

0 comments on commit bec45cf

Please sign in to comment.