-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
45 lines (38 loc) · 1.19 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
## MAIN FILE CONTAINING PROVIDER AND INSTANCE RESOURCES ##
provider "aws" {
profile = "${var.aws_profile}"
region = "${var.region}"
}
resource "aws_instance" "gateway" {
ami = "${var.ami_id}"
instance_type = "${var.gateway_instance_type}"
key_name = "${var.keypair}"
tags = {
Name = "tank-gateway"
}
root_block_device {
volume_type = "standard"
volume_size = "${var.bastion_disk_size}"
delete_on_termination = true
}
ephemeral_block_device {
no_device = true
device_name = "/dev/sda"
}
vpc_security_group_ids = [ "${aws_security_group.ssh.id}" ]
associate_public_ip_address = true
subnet_id = "${aws_subnet.tank_public_subnet[0].id}"
}
resource "aws_instance" "cassandra" {
ami = "${var.ami_id}"
instance_type = "${var.cassandra_instance_type}"
count = "${var.cassandra_node_count}"
key_name = "${var.keypair}"
tags = {
Name = "${var.ec2_cassandra_instance_prefix}-${count.index}"
}
# user_data = "${file("files/attach_ebs.sh")}"
vpc_security_group_ids = [ "${aws_security_group.ssh.id}" ]
associate_public_ip_address = false
subnet_id = "${aws_subnet.tank_private_subnet[ count.index % 2 == 0 ? 0 : 1].id}"
}