forked from OguzPastirmaci/oci-hpc-clusternetwork-tifr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instance-pool-configuration.tf
executable file
·40 lines (35 loc) · 1.25 KB
/
instance-pool-configuration.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
resource "oci_core_instance_configuration" "instance_pool_configuration" {
count = var.cluster_network ? 0 : 1
depends_on = [oci_core_app_catalog_subscription.mp_image_subscription]
compartment_id = var.targetCompartment
display_name = local.cluster_name
instance_details {
instance_type = "compute"
launch_details {
availability_domain = var.ad
compartment_id = var.targetCompartment
create_vnic_details {
}
display_name = local.cluster_name
metadata = {
# TODO: add user key to the authorized_keys
ssh_authorized_keys = "${var.ssh_key}\n${tls_private_key.ssh.public_key_openssh}"
user_data = base64encode(data.template_file.config.rendered)
}
shape = var.instance_pool_shape
dynamic "shape_config" {
for_each = local.is_instance_pool_flex_shape
content {
ocpus = shape_config.value
memory_in_gbs = var.instance_pool_custom_memory ? var.instance_pool_memory : 16 * shape_config.value
}
}
source_details {
source_type = "image"
boot_volume_size_in_gbs = var.boot_volume_size
image_id = local.instance_pool_image
}
}
}
source = "NONE"
}