-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.tf
97 lines (80 loc) · 2.82 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
module "resourcegroup" {
source = "./modules/resourcegroup"
namespace = var.namespace
location = var.location
}
module "networking" {
source = "./modules/networking"
location = var.location
namespace = module.resourcegroup.namespace
resource_group_name = module.resourcegroup.resource_group_name
}
module "loadbalancing" {
source = "./modules/loadbalancing"
location = var.location
namespace = module.resourcegroup.namespace
resource_group_name = module.resourcegroup.resource_group_name
}
module "consul_servers" {
source = "./modules/cluster"
location = var.location
instance_count = var.consul.servers_count
instance_size = var.consul.server_instance_size
datacenter = var.datacenter
join_wan = var.join_wan
admin = var.admin
consul = {
version = var.consul.version
mode = "server"
}
associate_public_ips = var.associate_public_ips
namespace = module.resourcegroup.namespace
vpc = module.networking.vpc
security_group_id = module.networking.sg.consul_server
resource_group_name = module.resourcegroup.resource_group_name
lb_backend_address_pool_ids = module.loadbalancing.lb_backend_address_pool_ids.consul
}
module "nomad_servers" {
source = "./modules/cluster"
instance_count = var.nomad.servers_count
instance_size = var.nomad.server_instance_size
location = var.location
datacenter = var.datacenter
admin = var.admin
nomad = {
version = var.nomad.version
mode = "server"
}
consul = {
version = var.consul.version
mode = "client"
}
associate_public_ips = var.associate_public_ips
namespace = module.resourcegroup.namespace
vpc = module.networking.vpc
security_group_id = module.networking.sg.nomad_server
resource_group_name = module.resourcegroup.resource_group_name
lb_backend_address_pool_ids = module.loadbalancing.lb_backend_address_pool_ids.nomad
}
module "nomad_clients" {
source = "./modules/cluster"
instance_count = var.nomad.clients_count
instance_size = var.nomad.client_instance_size
location = var.location
datacenter = var.datacenter
admin = var.admin
nomad = {
version = var.nomad.version
mode = "client"
}
consul = {
version = var.consul.version
mode = "client"
}
associate_public_ips = false
namespace = module.resourcegroup.namespace
vpc = module.networking.vpc
security_group_id = module.networking.sg.nomad_client
resource_group_name = module.resourcegroup.resource_group_name
lb_backend_address_pool_ids = module.loadbalancing.lb_backend_address_pool_ids.fabio
}