-
Notifications
You must be signed in to change notification settings - Fork 1
/
dse.tf
49 lines (42 loc) · 1.11 KB
/
dse.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
resource "oci_core_instance" "dse" {
display_name = "dse-${count.index}"
compartment_id = var.compartment_ocid
availability_domain = data.oci_identity_availability_domains.availability_domains.availability_domains[0]["name"]
shape = var.node_shape
source_details {
source_id = data.oci_core_images.ubuntu_18.images[0].id
source_type = "image"
}
lifecycle {
ignore_changes = [
source_details[0].source_id
]
}
create_vnic_details {
subnet_id = oci_core_subnet.subnet.id
hostname_label = "dse-${count.index}"
}
metadata = {
ssh_authorized_keys = join(
"\n",
[
var.ssh_public_key,
tls_private_key.ssh_key.public_key_openssh
]
)
user_data = base64encode(
join(
"\n",
[
"#!/usr/bin/env bash",
"password=${var.password}",
file("./scripts/dse.sh"),
],
),
)
}
freeform_tags = {
"quick-start" = "{\"Deployment\":\"TF\", \"Publisher\":\"DataStax\", \"Offer\":\"dse\",\"Licence\":\"byol\"}"
}
count = var.node_count
}