Skip to content

Commit ec8bbb7

Browse files
committed
Automation Toolkit Release v2024.2.1
1 parent 86ab16f commit ec8bbb7

File tree

59 files changed

+295
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+295
-293
lines changed

cd3_automation_toolkit/Identity/Compartments/create_terraform_compartments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def travel(parent, keys, values, c):
243243
oname[reg].close()
244244
print(outfile[reg] + " for Compartments has been created for region " + reg)
245245

246-
fetch_comp_file = f'{outdir}/fetchcompinfo.safe'
246+
fetch_comp_file = f'{outdir}/.safe/fetchcompinfo.safe'
247247
with open(fetch_comp_file, 'w') as f:
248248
f.write('run_fetch_script=1')
249249
f.close()

cd3_automation_toolkit/Network/BaseNetwork/export_network_nonGreenField.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def get_comp_details(comp_data):
407407
importCommands_rpc["global"].write(
408408
"\nterraform import \"module.rpcs[\\\"" + rpc_tf_name + f"\\\"].oci_core_remote_peering_connection.{source_region.lower()}_{region.lower()}_accepter_rpc[\\\"region\\\"]\" " + str(
409409
dest_rpc_id))
410-
410+
importCommands_rpc["global"].write("\nterraform plan")
411411
for col_header in values_for_column:
412412
if col_header == 'Region':
413413
values_for_column[col_header].append(source_region)

cd3_automation_toolkit/Network/Global/templates/rpc-root-terraform-template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module "rpcs" {
88
source = "../modules/rpc"
99
for_each = var.drg_other_attachments
1010

11-
requester_compartment_id = each.value.requester_compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.requester_compartment_id)) > 0 ? each.value.requester_compartment_id : var.compartment_ocids[each.value.requester_compartment_id]) : null
12-
accepter_compartment_id = each.value.accepter_compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.accepter_compartment_id)) > 0 ? each.value.accepter_compartment_id : var.compartment_ocids[each.value.accepter_compartment_id]) : null
11+
requester_compartment_id = each.value.requester_compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.requester_compartment_id)) > 0 ? each.value.requester_compartment_id : var.compartment_ocids[each.value.requester_compartment_id]) : null
12+
accepter_compartment_id = each.value.accepter_compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.accepter_compartment_id)) > 0 ? each.value.accepter_compartment_id : var.compartment_ocids[each.value.accepter_compartment_id]) : null
1313
display_name = each.value.display_name
1414

1515
#Requester

cd3_automation_toolkit/Release-Notes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Apr 30, 2024
55
1. Download latest Excel Sheet using Jenkins.
66
2. Docker Image upgrade to OL9 and upgrade of other softwares also.
77
3. Dropdowns for Region and Compartment while running setUpOCI using Jenkins.
8-
4. Fix Image OCIDs for OCI Work VM deployment using RM stack.
9-
5. Review of existing terraform modules.
8+
4. Take out Security List from Network stack.
9+
5. Fix Image OCIDs for OCI Work VM deployment using RM stack.
10+
6. Review of existing terraform modules.
1011

1112
-------------------------------------
1213
CD3 Automation Toolkit Tag v2024.2.0

cd3_automation_toolkit/user-scripts/terraform/adb.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data "oci_core_subnets" "oci_subnets_adb" {
88
# depends_on = [module.subnets] # Uncomment to create Network and FSS together
99
#for_each = var.adb != null ? var.adb : {}
1010
for_each = { for k, v in var.adb : k => v if v.vcn_name != null }
11-
compartment_id = each.value.network_compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.network_compartment_id)) > 0 ? each.value.network_compartment_id : var.compartment_ocids[each.value.network_compartment_id]) : var.compartment_ocids[each.value.network_compartment_id]
11+
compartment_id = each.value.network_compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.network_compartment_id)) > 0 ? each.value.network_compartment_id : var.compartment_ocids[each.value.network_compartment_id]) : var.compartment_ocids[each.value.network_compartment_id]
1212
display_name = each.value.subnet_id
1313
vcn_id = data.oci_core_vcns.oci_vcns_adb[each.key].virtual_networks.*.id[0]
1414
}
@@ -17,7 +17,7 @@ data "oci_core_vcns" "oci_vcns_adb" {
1717
# depends_on = [module.vcns] # Uncomment to create Network and FSS together
1818
#for_each = var.adb != null ? var.adb : {}
1919
for_each = { for k, v in var.adb : k => v if v.vcn_name != null }
20-
compartment_id = each.value.network_compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.network_compartment_id)) > 0 ? each.value.network_compartment_id : var.compartment_ocids[each.value.network_compartment_id]) : var.compartment_ocids[each.value.network_compartment_id]
20+
compartment_id = each.value.network_compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.network_compartment_id)) > 0 ? each.value.network_compartment_id : var.compartment_ocids[each.value.network_compartment_id]) : var.compartment_ocids[each.value.network_compartment_id]
2121
display_name = each.value.vcn_name
2222
}
2323

@@ -27,7 +27,7 @@ module "adb" {
2727
# depends_on = [module.vcns, module.subnets]
2828
admin_password = each.value.admin_password
2929
character_set = each.value.character_set
30-
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : null
30+
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : null
3131
cpu_core_count = each.value.cpu_core_count
3232
database_edition = each.value.database_edition
3333
data_storage_size_in_tbs = each.value.data_storage_size_in_tbs
@@ -39,10 +39,10 @@ module "adb" {
3939
license_model = each.value.license_model
4040
ncharacter_set = each.value.ncharacter_set
4141
customer_contacts = each.value.customer_contacts
42-
network_compartment_id = each.value.network_compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.network_compartment_id)) > 0 ? each.value.network_compartment_id : var.compartment_ocids[each.value.network_compartment_id]) : null
42+
network_compartment_id = each.value.network_compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.network_compartment_id)) > 0 ? each.value.network_compartment_id : var.compartment_ocids[each.value.network_compartment_id]) : null
4343
network_security_group_ids = each.value.nsg_ids
4444
freeform_tags = each.value.freeform_tags
45-
subnet_id = each.value.subnet_id != null ? (length(regexall("ocid1.subnet.oc1*", each.value.subnet_id)) > 0 ? each.value.subnet_id : data.oci_core_subnets.oci_subnets_adb[each.key].subnets.*.id[0]) : null
45+
subnet_id = each.value.subnet_id != null ? (length(regexall("ocid1.subnet.oc*", each.value.subnet_id)) > 0 ? each.value.subnet_id : data.oci_core_subnets.oci_subnets_adb[each.key].subnets.*.id[0]) : null
4646
vcn_name = each.value.vcn_name != null ? each.value.vcn_name : null
4747
whitelisted_ips = each.value.whitelisted_ips
4848

cd3_automation_toolkit/user-scripts/terraform/block-volume.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
data "oci_core_instances" "instance" {
99
depends_on = [module.instances]
1010
for_each = var.blockvolumes != null ? var.blockvolumes : {}
11-
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : null
11+
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : null
1212
display_name = one(each.value.attach_to_instance)
1313
state = "RUNNING"
1414
}
@@ -18,10 +18,10 @@ module "block-volumes" {
1818
source = "./modules/storage/block-volume"
1919
for_each = var.blockvolumes != null ? var.blockvolumes : {}
2020
attachment_type = each.value.attachment_type
21-
attach_to_instance = each.value.attach_to_instance != null ? length(regexall("ocid1.instance.oc1*", each.value.attach_to_instance)) > 0 ? each.value.attach_to_instance : merge(module.instances.*...)[each.value.attach_to_instance]["instance_tf_id"] : null
21+
attach_to_instance = each.value.attach_to_instance != null ? length(regexall("ocid1.instance.oc*", each.value.attach_to_instance)) > 0 ? each.value.attach_to_instance : merge(module.instances.*...)[each.value.attach_to_instance]["instance_tf_id"] : null
2222
#attach_to_instance = length(each.value.attach_to_instance) > 0 ? [data.oci_core_instances.instance[each.value.display_name].instances[0].id] : []
2323
availability_domain = each.value.availability_domain != "" && each.value.availability_domain != null ? data.oci_identity_availability_domains.availability_domains.availability_domains[each.value.availability_domain].name : null
24-
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : null
24+
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : null
2525
vpus_per_gb = each.value.vpus_per_gb != null ? each.value.vpus_per_gb : null
2626
device = each.value.device
2727
defined_tags = each.value.defined_tags
@@ -31,7 +31,7 @@ module "block-volumes" {
3131
kms_key_id = each.value.kms_key_id
3232
size_in_gbs = each.value.size_in_gbs != null ? each.value.size_in_gbs : null
3333
block_tf_policy = each.value.backup_policy != null ? each.value.backup_policy : null
34-
policy_tf_compartment_id = each.value.policy_compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.policy_compartment_id)) > 0 ? each.value.policy_compartment_id : var.compartment_ocids[each.value.policy_compartment_id]) : null
34+
policy_tf_compartment_id = each.value.policy_compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.policy_compartment_id)) > 0 ? each.value.policy_compartment_id : var.compartment_ocids[each.value.policy_compartment_id]) : null
3535

3636

3737
#Volume Attachment Optional Params

cd3_automation_toolkit/user-scripts/terraform/budget.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module "budgets" {
1111

1212
#Required
1313
amount = each.value.amount
14-
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : var.tenancy_ocid
14+
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : var.tenancy_ocid
1515
reset_period = each.value.reset_period != null ? each.value.reset_period : "MONTHLY"
1616

1717
#Optional
@@ -21,7 +21,7 @@ module "budgets" {
2121
defined_tags = each.value.defined_tags
2222
freeform_tags = each.value.freeform_tags
2323
processing_period_type = each.value.processing_period_type
24-
#target_compartment_id = each.value.target_compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.target_compartment_id)) > 0 ? each.value.target_compartment_id : var.compartment_ocids[each.value.target_compartment_id]) : null
24+
#target_compartment_id = each.value.target_compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.target_compartment_id)) > 0 ? each.value.target_compartment_id : var.compartment_ocids[each.value.target_compartment_id]) : null
2525
target_type = each.value.target_type
2626
targets = each.value.targets != null ? [var.compartment_ocids[flatten([for targets in each.value.targets : targets])[0]]] : []
2727

@@ -32,7 +32,7 @@ module "budget-alert-rules" {
3232
for_each = var.budget_alert_rules != null ? var.budget_alert_rules : {}
3333

3434
#Required
35-
budget_id = each.value.budget_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.budget_id)) > 0 ? each.value.budget_id : merge(module.budgets.*...)[each.value.budget_id]["budget_tf_id"]) : null
35+
budget_id = each.value.budget_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.budget_id)) > 0 ? each.value.budget_id : merge(module.budgets.*...)[each.value.budget_id]["budget_tf_id"]) : null
3636
threshold = each.value.threshold
3737
threshold_type = each.value.threshold_type
3838
type = each.value.type

cd3_automation_toolkit/user-scripts/terraform/cloud-guard.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module "cloud-guard-configurations" {
1010
for_each = var.cloud_guard_configs != null ? var.cloud_guard_configs : {}
1111

1212
#Required
13-
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : var.tenancy_ocid
13+
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : var.tenancy_ocid
1414
reporting_region = each.value.reporting_region
1515
status = each.value.status
1616

@@ -25,9 +25,9 @@ module "cloud-guard-targets" {
2525
depends_on = [module.cloud-guard-configurations]
2626
#Required
2727
tenancy_ocid = var.tenancy_ocid
28-
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : var.tenancy_ocid
28+
compartment_id = each.value.compartment_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartment_ocids[each.value.compartment_id]) : var.tenancy_ocid
2929
display_name = each.value.display_name
30-
target_resource_id = each.value.target_resource_id != null ? (length(regexall("ocid1.compartment.oc1*", each.value.target_resource_id)) > 0 ? each.value.target_resource_id : var.compartment_ocids[each.value.target_resource_id]) : each.value.target_resource_id
30+
target_resource_id = each.value.target_resource_id != null ? (length(regexall("ocid1.compartment.oc*", each.value.target_resource_id)) > 0 ? each.value.target_resource_id : var.compartment_ocids[each.value.target_resource_id]) : each.value.target_resource_id
3131
target_resource_type = each.value.target_resource_type != null ? each.value.target_resource_type : "COMPARTMENT"
3232
prefix = each.value.prefix
3333

0 commit comments

Comments
 (0)