-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.tf
81 lines (71 loc) · 2.32 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module "resourcegroup" {
source = "./modules/resourcegroup"
namespace = var.namespace
}
module "networking" {
source = "./modules/networking"
namespace = module.resourcegroup.namespace
}
module "loadbalancing" {
source = "./modules/loadbalancing"
namespace = module.resourcegroup.namespace
sg = module.networking.sg
vpc = module.networking.vpc
}
module "consul_servers" {
source = "./modules/cluster"
associate_public_ips = var.associate_public_ips
ssh_keypair = var.ssh_keypair
instance_count = var.consul.servers_count
instance_type = var.consul.server_instance_type
datacenter = var.datacenter
join_wan = var.join_wan
consul = {
version = var.consul.version
mode = "server"
}
namespace = module.resourcegroup.namespace
vpc = module.networking.vpc
security_group_id = module.networking.sg.consul_server
target_group_arns = module.loadbalancing.target_group_arns.consul
}
module "nomad_servers" {
source = "./modules/cluster"
associate_public_ips = var.associate_public_ips
ssh_keypair = var.ssh_keypair
instance_count = var.nomad.servers_count
instance_type = var.nomad.server_instance_type
datacenter = var.datacenter
nomad = {
version = var.nomad.version
mode = "server"
}
consul = {
version = var.consul.version
mode = "client"
}
namespace = module.resourcegroup.namespace
vpc = module.networking.vpc
security_group_id = module.networking.sg.nomad_server
target_group_arns = module.loadbalancing.target_group_arns.nomad
}
module "nomad_clients" {
source = "./modules/cluster"
associate_public_ips = var.associate_public_ips
ssh_keypair = var.ssh_keypair
instance_count = var.nomad.clients_count
instance_type = var.nomad.client_instance_type
datacenter = var.datacenter
nomad = {
version = var.nomad.version
mode = "client"
}
consul = {
version = var.consul.version
mode = "client"
}
namespace = module.resourcegroup.namespace
security_group_id = module.networking.sg.nomad_client
vpc = module.networking.vpc
target_group_arns = module.loadbalancing.target_group_arns.fabio
}