-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathworker.tf
75 lines (63 loc) · 1.75 KB
/
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
resource "oci_core_instance" "worker" {
display_name = "kinetica-worker-${count.index}"
compartment_id = var.compartment_ocid
availability_domain = local.availability_domain
shape = var.shape
source_details {
source_id = local.image
source_type = "image"
}
create_vnic_details {
subnet_id = local.use_existing_network ? var.subnet_id : oci_core_subnet.simple_subnet[0].id
hostname_label = "kinetica-worker-${count.index}"
nsg_ids = [oci_core_network_security_group.simple_nsg.id]
assign_public_ip = local.is_public_subnet
}
metadata = {
ssh_authorized_keys = var.ssh_public_key
user_data = base64encode(
join(
"\n",
[
"#!/usr/bin/env bash",
file("./scripts/metadata.sh"),
file("./scripts/disks.sh"),
file("./scripts/worker.sh"),
],
),
)
}
extended_metadata = {
license_key = var.license_key
config = jsonencode(
{
"shape" = var.shape
"disk_count" = var.disk_count
"disk_size" = var.disk_size
"worker_count" = var.worker_count
"license_key" = var.license_key
},
)
}
lifecycle {
ignore_changes = [
source_details[0].source_id
]
}
count = var.worker_count
}
output "worker_public_ips" {
value = join(",", oci_core_instance.worker.*.public_ip)
}
output "worker_private_ips" {
value = join(",", oci_core_instance.worker.*.private_ip)
}
output "gadmin_url" {
value = "http://${oci_core_instance.worker[0].public_ip}:8080"
}
output "reveal_url" {
value = "http://${oci_core_instance.worker[0].public_ip}:8088"
}
output "aaw_url" {
value = "http://${oci_core_instance.worker[0].public_ip}:8070"
}