-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-ec2-consul.tf
48 lines (39 loc) · 1.8 KB
/
create-ec2-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
module "ec2_consul_a" {
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 2.0"
name = "${var.project_tags.project}-consul-a"
instance_count = 1
ami = var.instance_ami
instance_type = var.instance_type
key_name = var.instance_keypair
monitoring = true
vpc_security_group_ids = ["${module.consul_sg.security_group_id}", "${module.ssh_internal_sg.security_group_id}", "${module.ssh_bastion_sg.security_group_id}"]
subnet_id = module.vpc.private_subnets[0]
tags = var.project_tags
}
module "ec2_consul_b" {
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 2.0"
name = "${var.project_tags.project}-consul-b"
instance_count = 1
ami = var.instance_ami
instance_type = var.instance_type
key_name = var.instance_keypair
monitoring = true
vpc_security_group_ids = ["${module.consul_sg.security_group_id}", "${module.ssh_internal_sg.security_group_id}", "${module.ssh_bastion_sg.security_group_id}"]
subnet_id = module.vpc.private_subnets[1]
tags = var.project_tags
}
module "ec2_consul_c" {
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 2.0"
name = "${var.project_tags.project}-consul-c"
instance_count = 1
ami = var.instance_ami
instance_type = var.instance_type
key_name = var.instance_keypair
monitoring = true
vpc_security_group_ids = ["${module.consul_sg.security_group_id}", "${module.ssh_internal_sg.security_group_id}", "${module.ssh_bastion_sg.security_group_id}"]
subnet_id = module.vpc.private_subnets[2]
tags = var.project_tags
}