File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
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 @@ -50,4 +50,8 @@ output "ns_objectstorage_namespace" {
5050}
5151output "autonomous_database_admin_password" {
5252 value = [ " Welcome12345" ]
53+ }
54+
55+ output "adb_ocid" {
56+ value = oci_database_autonomous_database. autonomous_database_atp . id
5357}
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}
Original file line number Diff line number Diff line change 284284
285285# Get MTDR_DB OCID
286286while ! state_done MTDR_DB_OCID; do
287- MTDR_DB_OCID=` oci db autonomous-database list --compartment-id " $( cat state/COMPARTMENT_OCID ) " --query ' join( ' " ' ' " ' ,data[?"display-name"== ' " 'MTDRDB' " ' ].id) ' -- raw-output `
287+ MTDR_DB_OCID=` terraform -chdir= " $MTDRWORKSHOP_LOCATION /terraform " output -- raw adb_ocid `
288288 if [[ " $MTDR_DB_OCID " =~ ocid1.autonomousdatabase* ]]; then
289289 state_set MTDR_DB_OCID " $MTDR_DB_OCID "
290290 else
You can’t perform that action at this time.
0 commit comments