github.com/SUSE/skuba@v1.4.17/ci/infra/aws/load-balancer.tf (about)

     1  resource "aws_elb" "kube_api" {
     2    connection_draining       = false
     3    cross_zone_load_balancing = true
     4    idle_timeout              = 400
     5    instances                 = aws_instance.control_plane.*.id
     6    name                      = "${var.stack_name}-elb"
     7    subnets                   = [aws_subnet.public.id]
     8  
     9    security_groups = [
    10      aws_security_group.elb.id,
    11      aws_security_group.egress.id,
    12    ]
    13  
    14    # kube
    15    listener {
    16      instance_port     = 6443
    17      instance_protocol = "tcp"
    18      lb_port           = 6443
    19      lb_protocol       = "tcp"
    20    }
    21  
    22    # dex - protocol is set to tcp instead of https. Otherwise
    23    # we would have to create the SSL certificate right now
    24    listener {
    25      instance_port     = 32000
    26      instance_protocol = "tcp"
    27      lb_port           = 32000
    28      lb_protocol       = "tcp"
    29    }
    30  
    31    # gangway - protocol is set to tcp instead of https. Otherwise
    32    # we would have to create the SSL certificate right now
    33    listener {
    34      instance_port     = 32001
    35      instance_protocol = "tcp"
    36      lb_port           = 32001
    37      lb_protocol       = "tcp"
    38    }
    39  
    40    health_check {
    41      healthy_threshold   = 2
    42      interval            = 30
    43      target              = "TCP:6443"
    44      timeout             = 3
    45      unhealthy_threshold = 6
    46    }
    47  }
    48  
    49  output "elb_address" {
    50    value = aws_elb.kube_api.dns_name
    51  }
    52