-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
45 lines (37 loc) · 1.52 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
module "security_groups" {
source = "./modules/security_groups"
vpc_id = "${aws_vpc.nomad.id}"
}
module "iam" {
source = "./modules/iam"
}
module "master_asg" {
source = "./modules/master/asg"
num_masters = "${var.num_masters}"
vpc_id = "${aws_vpc.nomad.id}"
key_name = "${var.key_name}"
vpc_cidr = "${var.cidr_vpc}"
subnet_masters_id = "${aws_subnet.masters.id}"
availability_zones = "${var.availability_zones}"
instance_type = "${var.master_instance_type}"
instance_profile = "${module.iam.instance_profile}"
security_groups = ["${module.security_groups.main}"]
instance_name = "${var.master_instance_name}"
consul_acl_enable = "${var.consul_acl_enable}"
consul_acl_master_token = "${var.consul_acl_master_token}"
}
module "slave_asg" {
source = "./modules/slave/asg"
num_slaves = "${var.num_slaves}"
subnet_slaves = "${aws_subnet.slaves.*.id}"
availability_zones = "${var.availability_zones}"
instance_type = "${var.slave_instance_type}"
key_name = "${var.key_name}"
security_groups = "${concat(list(module.security_groups.main), var.slave_security_groups)}"
instance_profile = "${module.iam.instance_profile}"
instance_name = "${var.slave_instance_name}"
master_instance_name = "${var.master_instance_name}"
consul_acl_enable = "${var.consul_acl_enable}"
consul_acl_client_token = "${var.consul_acl_client_token}"
target_group_arns = "${var.slave_target_group_arns}"
}