-
Notifications
You must be signed in to change notification settings - Fork 0
/
load_balancer.tf
45 lines (36 loc) · 943 Bytes
/
load_balancer.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
module "elb" {
source = "terraform-aws-modules/elb/aws"
name = "elb1"
subnets = [aws_subnet.cidr1.id]
security_groups = [aws_security_group.elb.id]
internal = false
listener = [
{
instance_port = 8080
instance_protocol = "HTTP"
lb_port = 80
lb_protocol = "HTTP"
},
{
instance_port = 8080
instance_protocol = "HTTP"
lb_port = 443
lb_protocol = "HTTPS"
ssl_certificate_id = aws_acm_certificate.cert1.arn
}
]
health_check = {
target = "TCP:8080"
interval = 30
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 5
}
number_of_instances = 1
instances = [aws_instance.instance1.id]
tags = {
Name = "${var.PROJECT_NAME}_key-elb1"
Terraform = "true"
Environment = "dev"
}
}