Skip to content

Commit

Permalink
Set correct TG for listeners for Terraform 0.11 (fixed #119) (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidan-melen authored and antonbabenko committed Nov 20, 2019
1 parent 2d5d4e9 commit 8d558c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions alb_no_logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_lb_listener" "frontend_http_tcp_no_logs" {
count = "${var.create_alb && !var.logging_enabled ? var.http_tcp_listeners_count : 0}"

default_action {
target_group_arn = "${aws_lb_target_group.main_no_logs.*.id[lookup(var.http_tcp_listeners[count.index], "target_group_index", 0)]}"
target_group_arn = "${aws_lb_target_group.main_no_logs.*.id[lookup(var.http_tcp_listeners[count.index], "target_group_index", count.index)]}"
type = "forward"
}
}
Expand All @@ -76,7 +76,7 @@ resource "aws_lb_listener" "frontend_https_no_logs" {
count = "${var.create_alb && !var.logging_enabled ? var.https_listeners_count : 0}"

default_action {
target_group_arn = "${aws_lb_target_group.main_no_logs.*.id[lookup(var.https_listeners[count.index], "target_group_index", 0)]}"
target_group_arn = "${aws_lb_target_group.main_no_logs.*.id[lookup(var.https_listeners[count.index], "target_group_index", count.index)]}"
type = "forward"
}
}
Expand Down
4 changes: 2 additions & 2 deletions alb_w_logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ resource "aws_lb_listener" "frontend_http_tcp" {
count = "${var.create_alb && var.logging_enabled ? var.http_tcp_listeners_count : 0}"

default_action {
target_group_arn = "${aws_lb_target_group.main.*.id[lookup(var.http_tcp_listeners[count.index], "target_group_index", 0)]}"
target_group_arn = "${aws_lb_target_group.main.*.id[lookup(var.http_tcp_listeners[count.index], "target_group_index", count.index)]}"
type = "forward"
}
}
Expand All @@ -82,7 +82,7 @@ resource "aws_lb_listener" "frontend_https" {
count = "${var.create_alb && var.logging_enabled ? var.https_listeners_count : 0}"

default_action {
target_group_arn = "${aws_lb_target_group.main.*.id[lookup(var.https_listeners[count.index], "target_group_index", 0)]}"
target_group_arn = "${aws_lb_target_group.main.*.id[lookup(var.https_listeners[count.index], "target_group_index", count.index)]}"
type = "forward"
}
}
Expand Down

0 comments on commit 8d558c1

Please sign in to comment.