Skip to content

Commit c4b94e6

Browse files
committed
Updating count reference
1 parent 7c86635 commit c4b94e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ resource "aws_lb_target_group" "lb_https_tgs" {
158158
# AWS LOAD BALANCER - Listeners
159159
#------------------------------------------------------------------------------
160160
resource "aws_lb_listener" "lb_http_listeners" {
161-
count = var.enable_http ? length(aws_lb_target_group.lb_http_tgs) : 0
161+
count = var.enable_http ? length(var.http_ports) : 0
162162
load_balancer_arn = aws_lb.lb.arn
163163
port = element(aws_lb_target_group.lb_http_tgs.*.port, count.index)
164164
protocol = element(aws_lb_target_group.lb_http_tgs.*.protocol, count.index)
@@ -169,7 +169,7 @@ resource "aws_lb_listener" "lb_http_listeners" {
169169
}
170170

171171
resource "aws_lb_listener" "lb_https_listeners" {
172-
count = var.enable_https ? length(aws_lb_target_group.lb_https_tgs) : 0
172+
count = var.enable_https ? length(var.https_ports) : 0
173173
load_balancer_arn = aws_lb.lb.arn
174174
port = element(aws_lb_target_group.lb_https_tgs.*.port, count.index)
175175
protocol = element(aws_lb_target_group.lb_https_tgs.*.protocol, count.index)

0 commit comments

Comments
 (0)