-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbluedata_infra_mapr_cluster2_worker.tf
107 lines (90 loc) · 3.38 KB
/
bluedata_infra_mapr_cluster2_worker.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
98
99
100
101
102
103
104
105
106
107
resource "aws_instance" "mapr_cluster_2_hosts" {
count = var.mapr_cluster_2_count
ami = var.EC2_UBUNTU1804_AMIS[var.region]
instance_type = var.mapr_instance_type
key_name = aws_key_pair.main.key_name
vpc_security_group_ids = [
module.network.security_group_allow_all_from_client_ip,
module.network.security_group_main_id
]
subnet_id = module.network.subnet_main_id
root_block_device {
volume_type = "gp2"
volume_size = 400
tags = {
Name = "${var.project_id}-instance-mapr-cluster-2-host-${count.index}-root-ebs"
Project = var.project_id
user = local.user
deployment_uuid = random_uuid.deployment_uuid.result
}
}
tags = {
Name = "${var.project_id}-instance-mapr-cluster-2-host-${count.index}"
Project = var.project_id
user = local.user
deployment_uuid = random_uuid.deployment_uuid.result
}
}
# /dev/sdd
resource "aws_ebs_volume" "mapr-cluster-2-host-ebs-volumes-sdd" {
count = var.mapr_cluster_2_count
availability_zone = var.az
size = 500
type = "gp2"
tags = {
Name = "${var.project_id}-mapr-cluster-2-host-${count.index}-ebs-sdd"
Project = var.project_id
user = local.user
deployment_uuid = random_uuid.deployment_uuid.result
}
}
resource "aws_volume_attachment" "mapr-cluster-2-host-volume-attachment-sdd" {
count = var.mapr_cluster_2_count
device_name = "/dev/sdd"
volume_id = aws_ebs_volume.mapr-cluster-2-host-ebs-volumes-sdd.*.id[count.index]
instance_id = aws_instance.mapr_cluster_2_hosts.*.id[count.index]
# hack to allow `terraform destroy ...` to work: https://github.com/hashicorp/terraform/issues/2957
force_detach = true
}
# /dev/sde
resource "aws_ebs_volume" "mapr-cluster-2-host-ebs-volumes-sde" {
count = var.mapr_cluster_2_count
availability_zone = var.az
size = 500
type = "gp2"
tags = {
Name = "${var.project_id}-mapr-cluster-2-host-${count.index}-ebs-sde"
Project = var.project_id
user = local.user
deployment_uuid = random_uuid.deployment_uuid.result
}
}
resource "aws_volume_attachment" "mapr-cluster-2-host-volume-attachment-sde" {
count = var.mapr_cluster_2_count
device_name = "/dev/sde"
volume_id = aws_ebs_volume.mapr-cluster-2-host-ebs-volumes-sde.*.id[count.index]
instance_id = aws_instance.mapr_cluster_2_hosts.*.id[count.index]
# hack to allow `terraform destroy ...` to work: https://github.com/hashicorp/terraform/issues/2957
force_detach = true
}
# /dev/sdf
resource "aws_ebs_volume" "mapr-cluster-2-host-ebs-volumes-sdf" {
count = var.mapr_cluster_2_count
availability_zone = var.az
size = 500
type = "gp2"
tags = {
Name = "${var.project_id}-mapr-cluster-2-host-${count.index}-ebs-sdf"
Project = var.project_id
user = local.user
deployment_uuid = random_uuid.deployment_uuid.result
}
}
resource "aws_volume_attachment" "mapr-cluster-2-host-volume-attachment-sdf" {
count = var.mapr_cluster_2_count
device_name = "/dev/sdf"
volume_id = aws_ebs_volume.mapr-cluster-2-host-ebs-volumes-sdf.*.id[count.index]
instance_id = aws_instance.mapr_cluster_2_hosts.*.id[count.index]
# hack to allow `terraform destroy ...` to work: https://github.com/hashicorp/terraform/issues/2957
force_detach = true
}