From 5ac3a6529281d9873be7e79e251a44746564926f Mon Sep 17 00:00:00 2001 From: "orasenatdpltintegration03/oracleidentitycloudservice/andrei.ilas@oracle.com" Date: Wed, 28 Feb 2024 12:33:15 +0200 Subject: [PATCH] Update drg module version. Add support for custom existing DRG compartment ID. --- module-network.tf | 13 +++++++------ variables-network.tf | 6 ++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/module-network.tf b/module-network.tf index bd5c9cd5..b70c9dbf 100644 --- a/module-network.tf +++ b/module-network.tf @@ -78,13 +78,14 @@ module "vcn" { } module "drg" { - count = tobool(var.create_drg) || var.drg_id != null ? 1 : 0 - source = "oracle-terraform-modules/drg/oci" - version = "1.0.5" - compartment_id = coalesce(var.network_compartment_id, local.compartment_id) + count = tobool(var.create_drg) || var.drg_id != null ? 1 : 0 + source = "oracle-terraform-modules/drg/oci" + version = "1.0.6" + compartment_id = coalesce(var.network_compartment_id, local.compartment_id) + drg_compartment_id = var.drg_compartment_id - drg_id = one([var.drg_id]) # existing DRG ID or null - drg_display_name = coalesce(var.drg_display_name, "oke-${local.state_id}") + drg_id = one([var.drg_id]) # existing DRG ID or null + drg_display_name = coalesce(var.drg_display_name, "oke-${local.state_id}") drg_vcn_attachments = tobool(var.create_drg) ? { for k, v in module.vcn : k => { # gets the vcn_id values dynamically from the vcn module vcn_id : v.vcn_id diff --git a/variables-network.tf b/variables-network.tf index 40ef99f9..5904be11 100644 --- a/variables-network.tf +++ b/variables-network.tf @@ -79,6 +79,12 @@ variable "drg_id" { type = string } +variable "drg_compartment_id" { + default = null + description = "Compartment for the DRG resource. Can be used to override network_compartment_id." + type = string +} + variable "drg_attachments" { description = "DRG attachment configurations." type = any