-
Notifications
You must be signed in to change notification settings - Fork 1
/
locals.tf
48 lines (38 loc) · 2.11 KB
/
locals.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
locals {
compute_flexible_shapes = [
"VM.Standard.E3.Flex",
"VM.Standard.E4.Flex",
"VM.Standard.A1.Flex",
"VM.Optimized3.Flex"
]
compute_arm_shapes = [
"VM.Standard.A1.Flex",
"BM.Standard.A1"
]
is_flexible_node_shape = contains(local.compute_flexible_shapes, var.oke_node_shape)
is_arm_node_shape = contains(local.compute_arm_shapes, var.oke_node_shape)
http_port_number = "80"
https_port_number = "443"
oke_api_endpoint_port_number = "6443"
oke_nodes_to_control_plane_port_number = "12250"
ssh_port_number = "22"
tcp_protocol_number = "6"
icmp_protocol_number = "1"
all_protocols = "all"
oke_nodes_min_port = "30000"
oke_nodes_max_port = "32767"
lb_listener_port = var.lb_listener_port == "" ? "80" : var.lb_listener_port
all_sources = data.oci_containerengine_node_pool_option.FoggyKitchenOKEClusterNodePoolOption.sources
arm_node_shape = local.is_arm_node_shape ? "aarch64-" : ""
kubernetes_version = substr(var.kubernetes_version,1,6)
oracle_linux_images = [
for source in local.all_sources : source.image_id if length(regexall("Oracle-Linux-${var.oke_node_os_version}-${local.arm_node_shape}[0-9][0-9][0-9][0-9].+-0-OKE-${local.kubernetes_version}-[0-9]+", source.source_name)) > 0
]
#oracle_linux_image_names = [
# for source in local.all_sources : source.source_name if length(regexall("Oracle-Linux-${var.oke_node_os_version}-${local.arm_node_shape}[0-9][0-9][0-9][0-9].+-OKE-${local.kubernetes_version}-[0-9]+", source.source_name)) > 0
#]
ocir_docker_repository = join("", [lower(lookup(data.oci_identity_regions.oci_regions.regions[0], "key")), ".ocir.io"])
ocir_namespace = lookup(data.oci_objectstorage_namespace.test_namespace, "namespace")
encode_user = urlencode(var.ocir_user_name)
auth_token = urlencode(var.ocir_user_password)
}