File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
operations/deployment/terraform/modules/aws/ecs Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -118,24 +118,28 @@ resource "aws_alb_listener_rule" "redirect_based_on_path" {
118118
119119resource "aws_alb_listener" "http_redirect" {
120120 count = var. aws_ecs_lb_redirect_enable && ! contains (local. aws_ecs_lb_port ,80 ) ? 1 : 0
121- load_balancer_arn = " ${ aws_alb . ecs_lb . id } "
121+ load_balancer_arn = aws_alb. ecs_lb . id
122122 port = " 80"
123123 protocol = " HTTP"
124124
125125
126126 default_action {
127- type = var. aws_certificate_enabled != " " ? " redirect" : " forward"
128- target_group_arn = var. aws_certificates_selected_arn != " " ? null : aws_alb_target_group. lb_targets [0 ]. id
127+ type = var. aws_certificate_enabled ? " redirect" : " forward"
128+ target_group_arn = var. aws_certificate_enabled ? null : aws_alb_target_group. lb_targets [0 ]. id
129129
130130 dynamic "redirect" {
131- for_each = var. aws_certificates_selected_arn != " " ? [1 ] : [0 ]
131+ for_each = var. aws_certificate_enabled ? [1 ] : [0 ]
132132 content {
133133 port = 443
134134 protocol = " HTTPS"
135135 status_code = " HTTP_301"
136136 }
137137 }
138138 }
139+ depends_on = [
140+ aws_alb . ecs_lb ,
141+ aws_alb_target_group . lb_targets
142+ ]
139143}
140144
141145resource "aws_security_group_rule" "incoming_alb_http" {
You can’t perform that action at this time.
0 commit comments