Skip to content

Commit

Permalink
Add replace_triggered_by for lb_https_listeners
Browse files Browse the repository at this point in the history
According to hashicorp/terraform#16065 (comment), the target must be replaced when a listener is replaced
  • Loading branch information
Atry authored Jul 6, 2022
1 parent 0cc27b4 commit 96025a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ resource "aws_lb_listener" "lb_http_listeners" {
type = "forward"
}
}

dynamic "lifecycle" {
for_each = (lookup(each.value, "type", "") == "" || lookup(each.value, "type", "") == "forward") ? [1] : []
replace_triggered_by {
target_group_id = aws_lb_target_group.lb_http_tgs[each.key].id
}
}

tags = var.tags
}
Expand Down

0 comments on commit 96025a4

Please sign in to comment.