Просмотр исходного кода

Adds a redirect from http to https for the jira ALB

To be tagged v1.21.6
Fred Damstra 4 лет назад
Родитель
Сommit
e0281d5b38
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      base/jira/instance_jira/elb.tf

+ 16 - 0
base/jira/instance_jira/elb.tf

@@ -64,6 +64,22 @@ resource "aws_alb_listener" "jira_server_https_external" {
   }
 }
 
+resource "aws_lb_listener" "jira_server_listener_http" {
+  load_balancer_arn = aws_alb.jira_server_external.arn
+  port              = "80"
+  protocol          = "HTTP"
+
+  default_action {
+    type             = "redirect"
+
+    redirect {
+      port        = "443"
+      protocol    = "HTTPS"
+      status_code = "HTTP_301"
+    }
+  }
+}
+
 # #########################
 # # DNS Entry
 module "public_dns_record" {