File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ application-cluster in different code bases!
11111 . LoadBalancer
1212
1313Resources for a LoadBalancer (default: ApplicationLoadBalancer) with
14- 1 Listener for Port 80
14+ 1 Listener for Port 80 (the default action is to redirect to https)
1515 1 Listener for Port 443 (An AWS-certificate is mandatory for this at the moment)
1616 1 Default Target Group (needed to define a listener)
1717
Original file line number Diff line number Diff line change @@ -24,8 +24,13 @@ resource "aws_lb_listener" "loadbalancer_listener" {
2424 protocol = " HTTP"
2525
2626 default_action {
27- target_group_arn = " ${ aws_lb_target_group . loadbalancer_default_target_group . arn } "
28- type = " forward"
27+ type = " redirect"
28+
29+ redirect {
30+ port = " 443"
31+ protocol = " HTTPS"
32+ status_code = " HTTP_301"
33+ }
2934 }
3035}
3136
You can’t perform that action at this time.
0 commit comments