Skip to content

Commit da2919b

Browse files
committed
Automation Toolkit Release v12.1
1 parent 4bd31ac commit da2919b

File tree

11 files changed

+38
-21
lines changed

11 files changed

+38
-21
lines changed

cd3_automation_toolkit/DeveloperServices/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
from .ResourceManager import *
44
from .OKE import *
5+

cd3_automation_toolkit/Network/BaseNetwork/create_all_tf_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ def create_all_tf_objects(inputfile, outdir, service_dir,prefix, config, non_gf_
4848
create_terraform_subnet_vlan(inputfile, outdir, service_dir, prefix, non_gf_tenancy, config, network_vlan_in_setupoci,modify_network)
4949

5050
if non_gf_tenancy == False:
51-
print('\n\nMake sure to export all SecRules, RouteRules and DRG RouteRules to CD3. Use sub-options 4,5,6 under option 3(Network) of Main Menu for the same.')
51+
print('\n\nMake sure to export all SecRules, RouteRules and DRG RouteRules to CD3. Use sub-options 3,4,5 under option 3(Network) of Main Menu for the same.')
5252

cd3_automation_toolkit/Release-Notes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,4 @@ Export Security Rules/Route Rules
402402
It also offers functionality to create OCS Work VM into customer's OCI tenancy using which all other tasks can be carried out.
403403
Please go through readMe under SetUpOCI_ViaTF for details on how to use the automation.
404404

405-
It works for 2 regions currently: Ashburn and Phoenix ie it works for customer tenancy subscribed to Ashburn and Phoenix
405+
It works for 2 regions currently: Ashburn and Phoenix ie it works for customer tenancy subscribed to Ashburn and Phoenix
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

cd3_automation_toolkit/user-scripts/OPA/Storage/oci_deny_public_bucket.rego

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ package terraform
55
#Ensure versioning is enabled for buckets.
66
import input as tfplan
77

8+
89
deny[reason] {
910
r = tfplan.resource_changes[_]
1011
r.mode == "managed"
1112
r.type == "oci_objectstorage_bucket"
1213
r.change.after.access_type == "ObjectRead"
14+
# r.change.after.kms_key_id == null
15+
# r.change.after.versioning == "Disabled"
16+
1317
reason := sprintf("%-40s :: OCI buckets must be private as per CIS standard's",
1418
[r.address])
1519
}
@@ -19,6 +23,7 @@ deny[reason] {
1923
r.mode == "managed"
2024
r.type == "oci_objectstorage_bucket"
2125
r.change.after.kms_key_id == null
26+
2227
reason := sprintf("%-40s :: OCI buckets must be encrypted with CMK as per CIS standard's",
2328
[r.address])
2429
}
@@ -27,7 +32,8 @@ deny[reason] {
2732
r = tfplan.resource_changes[_]
2833
r.mode == "managed"
2934
r.type == "oci_objectstorage_bucket"
30-
r.change.after.versioning == "Disabled"
35+
r.change.after.versioning == "Disabled"
36+
3137
reason := sprintf("%-40s :: OCI buckets should be private/versioning enabled/encrypted with CMK as per CIS standard's",
3238
[r.address])
3339
}
@@ -54,4 +60,4 @@ enforce_object_storage_config {
5460
bucket.is_public_access_allowed == false
5561
bucket.are_server_side_encryption_rules_enabled
5662
#bucket.defined_tags["cis.cis-benchmark"] == "true"
57-
}
63+
}

cd3_automation_toolkit/user-scripts/terraform/modules/compute/instance/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ resource "null_resource" "ansible-remote-exec" {
156156
inline = [
157157
"sudo dnf install -y epel-release",
158158
"sudo dnf install ansible -y",
159-
"sudo ansible --version",
160159
"sudo ansible-galaxy collection install community.general",
161160
"sudo ansible-galaxy collection install ansible.posix",
161+
"sudo ansible --version",
162162
"sudo chmod 777 /home/opc/${local.remote_execute_script}",
163163
"sudo touch /etc/cron.d/ansible",
164164
"sudo chmod 600 /etc/cron.d/ansible",
@@ -270,4 +270,4 @@ resource "oci_core_app_catalog_subscription" "mp_image_subscription" {
270270
timeouts {
271271
create = "20m"
272272
}
273-
}
273+
}

cd3_automation_toolkit/user-scripts/terraform/sddc.tf

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,36 @@ locals {
1414
}
1515
]])
1616

17-
ds_vols = flatten([
18-
for key, val in var.sddcs : [
19-
for item in (try (concat(val.management_datastore, val.workload_datastore),[])): {
20-
volume_compartment_id = split("@", item)[0]
21-
volume_display_name = split("@", item)[1]
22-
}
23-
]
24-
])
25-
management_datastores = { for key,val in var.sddcs : key =>
26-
try([for value in val.management_datastore: data.oci_core_volumes.ds_volumes[split("@", value)[1]].volumes.*.id[0]],[])
17+
ds_vols = flatten([ for key, val in var.sddcs : [
18+
for item in concat(local.mgmt_vols[val.display_name],local.wkld_vols[val.display_name]): {
19+
volume_display_name = item.volume_display_name
20+
volume_compartment_id = item.volume_compartment_id
21+
}
22+
]])
23+
24+
mgmt_vols = { for key, val in var.sddcs :
25+
val.display_name => try([for item in val.management_datastore: {
26+
volume_compartment_id = try(split("@", item)[0],null)
27+
volume_display_name = try(split("@", item)[1],null)
28+
}],[])}
29+
30+
wkld_vols = { for key, val in var.sddcs :
31+
val.display_name => try([ for item in val.workload_datastore:
32+
{
33+
volume_compartment_id = try(split("@", item)[0],null)
34+
volume_display_name = try(split("@", item)[1],null)
35+
}] ,[])}
36+
37+
management_datastores = { for key,val in var.sddcs : key => (val.management_datastore != null ? [for value in val.management_datastore: data.oci_core_volumes.ds_volumes[split("@", value)[1]].volumes.*.id[0]] : [])
2738
}
2839

29-
workload_datastores = {for key,val in var.sddcs: key =>
30-
try([for value in val.workload_datastore: data.oci_core_volumes.ds_volumes[split("@", value)[1]].volumes.*.id[0]],[])
40+
workload_datastores = {for key,val in var.sddcs: key => (val.workload_datastore != null ? [for value in val.workload_datastore: data.oci_core_volumes.ds_volumes[split("@", value)[1]].volumes.*.id[0]] : [])
3141
}
3242
}
3343

3444

3545
data "oci_core_volumes" "ds_volumes" {
36-
for_each = {for value in local.ds_vols : value.volume_display_name => value.volume_compartment_id if local.ds_vols != null }
46+
for_each = {for value in local.ds_vols : value.volume_display_name => value.volume_compartment_id if value.volume_display_name != null }
3747
compartment_id = each.value != null ? (length(regexall("ocid1.compartment.oc1*", each.value)) > 0 ? each.value : var.compartment_ocids[each.value]) : var.compartment_ocids[each.value]
3848
display_name = each.key
3949
state = "AVAILABLE"

0 commit comments

Comments
 (0)