Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion compartments/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ resource "oci_identity_compartment" "these" {
freeform_tags = merge(local.cislz_module_tag, each.value.freeform_tags)
}

resource "time_sleep" "wait_1_seconds_level_2" {
create_duration = "1s"
}

resource "oci_identity_compartment" "level_2" {
for_each = {for c in local.level_2 : c.key => {name: c.name,
description: c.description,
Expand All @@ -156,6 +160,11 @@ resource "oci_identity_compartment" "level_2" {
enable_delete = each.value.enable_delete
defined_tags = each.value.defined_tags
freeform_tags = merge(local.cislz_module_tag, each.value.freeform_tags)
depends_on = [time_sleep.wait_1_seconds_level_2]
}

resource "time_sleep" "wait_1_seconds_level_3" {
create_duration = "1s"
}

resource "oci_identity_compartment" "level_3" {
Expand All @@ -171,6 +180,11 @@ resource "oci_identity_compartment" "level_3" {
enable_delete = each.value.enable_delete
defined_tags = each.value.defined_tags
freeform_tags = merge(local.cislz_module_tag, each.value.freeform_tags)
depends_on = [time_sleep.wait_1_seconds_level_3]
}

resource "time_sleep" "wait_1_seconds_level_4" {
create_duration = "1s"
}

resource "oci_identity_compartment" "level_4" {
Expand All @@ -186,6 +200,11 @@ resource "oci_identity_compartment" "level_4" {
enable_delete = each.value.enable_delete
defined_tags = each.value.defined_tags
freeform_tags = merge(local.cislz_module_tag, each.value.freeform_tags)
depends_on = [time_sleep.wait_1_seconds_level_4]
}

resource "time_sleep" "wait_1_seconds_level_5" {
create_duration = "1s"
}

resource "oci_identity_compartment" "level_5" {
Expand All @@ -201,6 +220,11 @@ resource "oci_identity_compartment" "level_5" {
enable_delete = each.value.enable_delete
defined_tags = each.value.defined_tags
freeform_tags = merge(local.cislz_module_tag, each.value.freeform_tags)
depends_on = [time_sleep.wait_1_seconds_level_5]
}

resource "time_sleep" "wait_1_seconds_level_6" {
create_duration = "1s"
}

resource "oci_identity_compartment" "level_6" {
Expand All @@ -216,6 +240,7 @@ resource "oci_identity_compartment" "level_6" {
enable_delete = each.value.enable_delete
defined_tags = each.value.defined_tags
freeform_tags = merge(local.cislz_module_tag, each.value.freeform_tags)
depends_on = [time_sleep.wait_1_seconds_level_6]
}

resource "oci_identity_tag_default" "these" {
Expand All @@ -227,4 +252,4 @@ resource "oci_identity_tag_default" "these" {
tag_definition_id = each.value.tag_definition_id
value = each.value.default_value
is_required = each.value.is_user_required
}
}
6 changes: 5 additions & 1 deletion compartments/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ terraform {
oci = {
source = "oracle/oci"
}
time = {
source = "hashicorp/time"
version = "0.12.0"
}
}
experiments = [module_variable_optional_attrs]
}
}