|
1 | | -# Copyright 2017, 2021 Oracle Corporation and/or affiliates. |
| 1 | +# Copyright 2017, 2023 Oracle Corporation and/or affiliates. |
2 | 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl |
3 | 3 |
|
4 | 4 | locals { |
5 | | - tenancy_id = coalesce(var.tenancy_id, var.tenancy_ocid) |
6 | | - compartment_id = coalesce( |
7 | | - var.compartment_id, var.compartment_ocid, |
8 | | - var.tenancy_id, var.tenancy_ocid, |
9 | | - ) |
10 | | - user_id = var.user_id != "" ? var.user_id : var.current_user_ocid |
| 5 | + worker_image_id = (length(var.worker_group_image_id) > 0 ? var.worker_group_image_id |
| 6 | + : var.node_pool_image_id != "none" ? var.node_pool_image_id : "") |
| 7 | + worker_image_type = (length(var.worker_group_image_type) > 0 ? var.worker_group_image_type |
| 8 | + : var.node_pool_image_type != "none" ? var.node_pool_image_type : "") |
11 | 9 |
|
12 | | - api_private_key = ( |
13 | | - var.api_private_key != "" |
14 | | - ? try(base64decode(var.api_private_key), var.api_private_key) |
15 | | - : var.api_private_key_path != "" |
16 | | - ? file(var.api_private_key_path) |
17 | | - : null) |
18 | | - |
19 | | - bastion_public_ip = var.create_bastion_host == true ? module.bastion[0].bastion_public_ip : var.bastion_public_ip != "" ? var.bastion_public_ip: "" |
20 | | - operator_private_ip = var.create_operator == true ? module.operator[0].operator_private_ip : var.operator_private_ip !="" ? var.operator_private_ip: "" |
| 10 | + bastion_public_ip = var.create_bastion_host == true ? module.bastion[0].bastion_public_ip : var.bastion_public_ip != "" ? var.bastion_public_ip : "" |
| 11 | + operator_private_ip = var.create_operator == true ? module.operator[0].operator_private_ip : var.operator_private_ip != "" ? var.operator_private_ip : "" |
21 | 12 | operator_instance_principal_group_name = var.create_operator == true ? module.operator[0].operator_instance_principal_group_name : "" |
22 | 13 |
|
23 | | - vcn_id = var.create_vcn == true ? module.vcn[0].vcn_id : coalesce(var.vcn_id, try(data.oci_core_vcns.vcns[0].virtual_networks[0].id,"")) |
24 | | - ig_route_id = var.create_vcn == true ? module.vcn[0].ig_route_id : coalesce(var.ig_route_table_id, try(data.oci_core_route_tables.ig[0].route_tables[0].id,"")) |
25 | | - nat_route_id = var.create_vcn == true ? module.vcn[0].nat_route_id : coalesce(var.nat_route_table_id, try(data.oci_core_route_tables.nat[0].route_tables[0].id,"")) |
| 14 | + vcn_id = var.create_vcn == true ? module.vcn[0].vcn_id : coalesce(var.vcn_id, try(data.oci_core_vcns.vcns[0].virtual_networks[0].id, "")) |
| 15 | + ig_route_id = var.create_vcn == true ? module.vcn[0].ig_route_id : coalesce(var.ig_route_table_id, try(data.oci_core_route_tables.ig[0].route_tables[0].id, "")) |
| 16 | + nat_route_id = var.create_vcn == true ? module.vcn[0].nat_route_id : coalesce(var.nat_route_table_id, try(data.oci_core_route_tables.nat[0].route_tables[0].id, "")) |
26 | 17 |
|
27 | | - ssh_key_arg = var.ssh_private_key_path == "none" ? "" : " -i ${var.ssh_private_key_path}" |
28 | 18 | validate_drg_input = var.create_drg && (var.drg_id != null) ? tobool("[ERROR]: create_drg variable can not be true if drg_id is provided.]") : true |
| 19 | + |
| 20 | + worker_group_primary_subnet_id = coalesce( |
| 21 | + var.worker_group_primary_subnet_id, |
| 22 | + lookup(module.network.subnet_ids, "workers", "")) |
29 | 23 | } |
0 commit comments