-
Notifications
You must be signed in to change notification settings - Fork 3
/
8.elb.tf
62 lines (44 loc) · 1.17 KB
/
8.elb.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
resource "aws_elb" "kube_api_server" {
subnets = [for subnet in aws_subnet.private_subnets : subnet.id]
security_groups = [aws_security_group.elb.id]
listener {
lb_port = 6443
lb_protocol = "TCP"
instance_port = 6443
instance_protocol = "TCP"
}
internal = true
cross_zone_load_balancing = true
// The time in seconds that the connection is allowed to be idle.
idle_timeout = 60
connection_draining = false
tags = {
KubernetesCluster = local.cluster_name
format("kubernetes.io/cluster/%v", local.cluster_name) = "shared"
}
health_check {
target = "TCP:6443"
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 5
interval = 10
}
}
resource "aws_security_group" "elb" {
name_prefix = "elb"
vpc_id = aws_vpc.this.id
ingress {
description = "Allow all inbound traffic"
from_port = 6443
to_port = 6443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
description = "Allow all outbound traffic"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}