Skip to content

Commit bb482dd

Browse files
committed
Fix listener rule
1 parent ccdbc90 commit bb482dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

operations/deployment/terraform/modules/aws/ecs/aws_ecs_networking.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ resource "aws_alb_listener_rule" "redirect_based_on_path_for_http" {
193193

194194
resource "aws_lb_listener_rule" "redirect_www_to_apex" {
195195
count = var.aws_ecs_lb_www_to_apex_redirect && var.aws_r53_domain_name != "" ? 1 : 0
196-
listener_arn = var.aws_certificates_selected_arn != "" ? aws_alb_listener.https_redirect[0].arn : aws_alb_listener.http_redirect[0].arn
196+
listener_arn = var.aws_certificate_enabled ? aws_alb_listener.lb_listener_ssl[0].arn : aws_alb_listener.lb_listener[0].arn
197197
priority = 10
198198

199199
condition {
@@ -206,8 +206,8 @@ resource "aws_lb_listener_rule" "redirect_www_to_apex" {
206206
type = "redirect"
207207

208208
redirect {
209-
port = var.aws_certificates_selected_arn != "" ? "443" : "80"
210-
protocol = var.aws_certificates_selected_arn != "" ? "HTTPS" : "HTTP"
209+
port = var.aws_certificate_enabled ? "443" : "80"
210+
protocol = var.aws_certificate_enabled ? "HTTPS" : "HTTP"
211211
status_code = "HTTP_301"
212212
host = "${var.aws_r53_domain_name}"
213213
path = "/#{path}"

0 commit comments

Comments
 (0)