-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmain.tf
47 lines (39 loc) · 1.14 KB
/
main.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
resource "aws_lb" "master_lb" {
name = "${var.cluster_name}-${terraform.env}"
load_balancer_type = "application"
security_groups = ["${var.lb_security_group}"]
subnets = ["${var.subnet_ids}"]
}
resource "aws_lb_target_group" "zeppelin" {
name = "${var.cluster_name}-zeppelin-${terraform.env}"
port = "${var.zeppelin_port}"
protocol = "HTTPS"
vpc_id = "${var.vpc_id}"
health_check {
protocol = "HTTPS"
path = "/"
matcher = "200"
healthy_threshold = 2
unhealthy_threshold = 2
interval = 10
timeout = 2
}
}
resource "aws_lb_target_group_attachment" "zeppelin" {
target_group_arn = "${aws_lb_target_group.zeppelin.arn}"
target_id = "${var.master_id}"
lifecycle {
create_before_destroy = true
}
}
resource "aws_lb_listener" "ssl" {
load_balancer_arn = "${aws_lb.master_lb.arn}"
port = 443
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-TLS-1-2-2017-01"
certificate_arn = "${var.lb_cert_arn}"
default_action {
target_group_arn = "${aws_lb_target_group.zeppelin.arn}"
type = "forward"
}
}