Skip to content

Commit

Permalink
Update drg module version. Add support for custom existing DRG compar…
Browse files Browse the repository at this point in the history
…tment ID.
  • Loading branch information
robo-cap authored and hyder committed Mar 4, 2024
1 parent 10b2ae4 commit 5ac3a65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 7 additions & 6 deletions module-network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions variables-network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ac3a65

Please sign in to comment.