Skip to content

Commit d9737ed

Browse files
authored
Merge pull request #350 from alphagov/auth-1388-http-redirect
AUTH-1388: Add HTTP listener that redirects to HTTPS
2 parents 3012fb4 + b6a0824 commit d9737ed

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

ci/terraform/alb.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,22 @@ resource "aws_alb_listener_rule" "account_management_alb_listener_https_robots"
6868
values = ["/robots.txt"]
6969
}
7070
}
71+
}
72+
73+
resource "aws_alb_listener" "account_managment_alb_listener_http" {
74+
load_balancer_arn = aws_lb.account_management_alb.id
75+
port = 80
76+
protocol = "HTTP"
77+
78+
default_action {
79+
type = "redirect"
80+
81+
redirect {
82+
port = "443"
83+
protocol = "HTTPS"
84+
status_code = "HTTP_301"
85+
}
86+
}
87+
88+
tags = local.default_tags
7189
}

0 commit comments

Comments
 (0)