Support for Additional Attributes
Follow the below steps to add an attribute that is not present already in your Excel sheet -
- Add the attribute name to the CD3 Excel sheet (based on the resource the attribute belongs to) as given in Terraform Official Documentation.
- Uncomment the attribute in .tf files (terraform modules in outdirectory, if they are commented).
- Uncomment the attribute in Jinja template for the resource attribute. (Resource to Jinja template mapping is available here)
- Update the variable file for any additional changes like image ocids, ssh public keys, etc
Example 1: To add an attribute for Instances - (preserve_boot_volume)
- Here is the Terraform Hashicorp documentation for instances - https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_instance
-
Add an additional column preserve_boot_volume to the Instances Sheet as shown below. Optionally change the underscores to spaces for better readability.
-
Uncomment the parameter in instance.tf file if not already uncommented.
-
Uncomment the parameter in cd3_automation_toolkit\Compute\templates\instance-template . Any line that is between {#
#} are commented in Jinja templates. From the screenshot below we note that the condition for preserve_boot_volume is within the Jinja comments. Copy the highlighted line and place it after/outside line 184 (#}) as per below screenshot. Before:
After:
-
Apart from the above changes, optionally, update the instance_ssh_keys and instance_source_ocids in your variables file before executing the toolkit to generate the auto.tfvars for instances.
Example 2 : To Add Freeform Tags
- Automation Tool Kit allows the tagging of resources. To use this option, the user is required to add the below column to the appropriate CD3 sheet. Ex: To Tag your Instances, Open the ‘Instances’ sheet of your CD3 and add the column FreeForm Tags at the end.
Note
The Tag Values (Default and Freeform Tags) specified will apply to all the resources in the tab. Ex: The tags applied to VCNs will not be applied to its objects like IGW, NGW, SGW, LPG, etc Empty column values are allowed for FreeForm and Defined Tags; when used it does not attach any tags to the resource. eg: Row 1 in the below example Semi Colon is used as Delimiter between multiple tag values (Example as shown below)
-
Allowed Values for Tags include the following formats: (semi-colon delimited values to be entered)
Example:
S.No Freeform Tags Defined Tags 1. 2. Network=Test1;Network2=Test40 Operations.CostCenter=01;Users.Name=user01 3. Network=Test2; Network2=Test4 Application.Env=Dev 4. Network= OS.Version= 5. testing Platform.Usage -
Export of new attributes is only supported if the attribute name of Terraform documentation matches that of the Python SDK. Export may fail to fetch the data incase there is a mismatch of the variable names.
Resource to Template Mapping
The following Table maps the Excel Sheet to the Resources to the Templates:
CD3-CIS-template.xlsx:
Tab Name/SetUpOCI Option | Resource Name(OCI Console) | Jinja2 Template Path | Jinja2 Template Name! |
---|---|---|---|
VCNs SubnetsDHCP RouteRulesinOCI SecRulesinOCI NSGs |
Networking: Virtual Cloud Networks | cd3_automation_toolkit\Network\BaseNetwork\templates\ | major-objects-drgs-template major-objects-igws-template major-objects-ngws-template major-objects-lpgs-template major-objects-sgws-template major-objects-vcns-template major-objects-drg-attachments-template major-objects-default-dhcp-template subnet-template custom-dhcp-template drg-data-source-template drg-route-distribution-statement-template drg-route-distribution-template drg-route-rule-template drg-route-table-template default-route-table-template route-rule-template route-table-template default-seclist-template seclist-template sec-rule-template nsg-rule-template nsg-template |
Tags | Governance: Tag Namespace | cd3_automation_toolkit\Governance\Tagging\templates | tags-namespaces-template tags-keys-template tags-defaults-template |
OSS | Object Storage Bucket | cd3_automation_toolkit\Storage\ObjectStorage\templates | oss-policy-template oss-template |
OKE | Developer Service: Oracle Kubernetes Service | cd3_automation_toolkit\DeveloperServices\OKE\templates\ | cluster-template nodepool-template |
NLB-Listeners NLB-BackendSets-BackendServers |
Networking: Network Load Balancers | cd3_automation_toolkit\Networking\LoadBalancers\templates\ | nlb-template nlb-backend-set-template nlb-backend-server-template nlb-listener-template nlb-reserved-ips-template |
Logging | VCN Flow Logs Object Storage Bucket Logs |
cd3_automation_toolkit\ManagementServices\Logging\templates | logging-template |
LB-Hostname-Certs BackendSet-BackendServer RuleSet PathRouteSet LB-Listener |
Networking: Load Balancers | cd3_automation_toolkit\Networking\LoadBalancers\templates\ | lbr-template certificate-template hostname-template cipher-suite-template backend-server-template backend-set-template rule-set-template access-control-rules-template access-method-rules-template http-header-rules-template request-response-header-rules-template uri-redirect-rules-template path-route-set-template path-route-rules-template listener-template lbr-reserved-ips-template |
Key Vault | Key and Vault | cd3_automation_toolkit\Security\KeyVault\templates | keys-template vaults-template |
FSS | File Storage: File Systems | cd3_automation_toolkit\Storage\FileStorage\templates\ | fss-template export-resource-template export-options-template mount-target-template |
DedicatedVMHosts Instances |
Compute: Dedicated Virtual Machine Hosts Instances |
cd3_automation_toolkit\Compute\templates\ | dedicatedvmhosts-template instances-template |
Compartments Groups Policies |
Identity: Compartments Groups Dynamic Groups Policies |
cd3_automation_toolkit\Identity\Compartments\templates cd3_automation_toolkit\Identity\Groups\templates cd3_automation_toolkit\Identity\Policies\templates |
compartments-template groups-template policies-template |
Cloud Guard | Cloud Guard | cd3_automation_toolkit\Security\CloudGuard\templates | cloud-guard-config-template cloud-guard-target-template |
Budgets | Governance: Budgets | cd3_automation_toolkit\Governance\Billing\templates | budget-alert-rule-template budget-template |
BlockVolumes | Block Storage: Block Volumes | cd3_automation_toolkit\Storage\BlockVolume\templates\ | blockvolumes-template |
ADB DBSystems-VM-BM EXA-Infra EXA-VMClusters |
Autonomous Data Warehouse Autonomous Transaction Processing Bare Metal, VM and Exadata Infra, and Exadata VM Clusters |
cd3_automation_toolkit\Database\templates\ | adb-template dbsystems-vm-bm-template exa-infra-template exa-vmclusters-template |
CD3-CIS-ManagementServices-template.xlsx
Tab Name/SetUpOCI Option | Resource Name(OCI Console) | Jinja2 Template Path | Jinja2 Template Name! |
---|---|---|---|
Notifications Events Alarms ServiceConnectors |
Application Integration: Notification Events Service Alarms Service Connector Hub |
cd3_automation_toolkit\ManagementServices\EventsAndNotifications\templates cd3_automation_toolkit\ManagementServices\Monitoring\templates cd3_automation_toolkit\ManagementServices\ServiceConnectorHub\templates |
actions-template events-template notifications-topics-template notifications-subscriptions-template service-connectors-template |