-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-lb-consul.tf
71 lines (65 loc) · 1.54 KB
/
create-lb-consul.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
63
64
65
66
67
68
69
70
71
module "consul_nlb" {
source = "terraform-aws-modules/alb/aws"
version = "~> 6.0"
name = "consul"
load_balancer_type = "network"
internal = true
enable_cross_zone_load_balancing = true
vpc_id = module.vpc.vpc_id
subnets = module.vpc.private_subnets
target_groups = [
{
name_prefix = "con1-"
backend_protocol = "TCP"
backend_port = 8300
target_type = "instance"
targets = {
consula = {
target_id = module.ec2_consul_a.id[0]
port = 8300
},
consulb = {
target_id = module.ec2_consul_b.id[0]
port = 8300
},
consulc = {
target_id = module.ec2_consul_c.id[0]
port = 8300
}
}
},
{
name_prefix = "con2-"
backend_protocol = "TCP"
backend_port = 8301
target_type = "instance"
targets = {
consula = {
target_id = module.ec2_consul_a.id[0]
port = 8301
},
consulb = {
target_id = module.ec2_consul_b.id[0]
port = 8301
},
consulc = {
target_id = module.ec2_consul_c.id[0]
port = 8301
}
}
}
]
http_tcp_listeners = [
{
port = 8300
protocol = "TCP"
target_group_index = 0
},
{
port = 8301
protocol = "TCP"
target_group_index = 1
}
]
tags = var.project_tags
}