File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ resource "oci_containerengine_cluster" "mtdrworkshop_cluster" {
88 ]
99 subnet_id = oci_core_subnet. endpoint . id
1010 }
11- kubernetes_version = " v1.25.4 "
11+ kubernetes_version = local . latest
1212 name = " mtdrworkshopcluster-${ var . mtdrKey } "
1313 vcn_id = oci_core_vcn. okevcn . id
1414 # optional
@@ -36,7 +36,7 @@ resource "oci_containerengine_node_pool" "oke_node_pool" {
3636 # Required
3737 cluster_id = oci_containerengine_cluster. mtdrworkshop_cluster . id
3838 compartment_id = var. ociCompartmentOcid
39- kubernetes_version = " v1.25.4 "
39+ kubernetes_version = local . latest
4040 name = " Pool"
4141 # node_shape="VM.Standard2.4"
4242 # node_shape = "VM.Standard.B2.1"
@@ -80,4 +80,9 @@ data "oci_containerengine_node_pool_option" "mtdrworkshop_node_pool_option" {
8080locals {
8181 all_sources = data. oci_containerengine_node_pool_option . mtdrworkshop_node_pool_option . sources
8282 oracle_linux_images = [for source in local . all_sources : source . image_id if length (regexall (" Oracle-Linux-[0-9]*.[0-9]*-20[0-9]*" ,source. source_name )) > 0 ]
83- }
83+ }
84+
85+ locals {
86+ versions = reverse (sort (data. oci_containerengine_cluster_option . mtdrworkshop_cluster_option . kubernetes_versions ))
87+ latest = local. versions [0 ]
88+ }
Original file line number Diff line number Diff line change 11terraform {
2- required_providers {
2+ required_providers {
33 oci = {
4- source = " hashicorp /oci"
5- version = " 4.42 .0"
4+ source = " oracle /oci"
5+ version = " >= 5.9 .0"
66 }
77 }
88}
9+
910provider "oci" {
1011 region = var. ociRegionIdentifier
1112}
You can’t perform that action at this time.
0 commit comments