Skip to content

Using the Automation Toolkit with CLI


Important

Check out the Must Read section for managing network, compute and oci firewall resources.

High Level Steps to use toolkit with CLI

  1. Login to the CD3 Container.

  2. Check out CD3 Toolkit Process for workflows supported by the toolkit and choose the workflow.

  3. Use one of the templates from Excel Templates based on the workflow chosen.

  4. Review setUpOCI.properties file /cd3user/tenancies/<prefix>/<prefix>_setUpOCI.properties.

setUpOCI.properties

[Default]

#Input variables required to run setUpOCI script

#path to output directory where terraform file will be generated. eg /cd3user/tenancies/<prefix>/terraform_files
outdir=

#prefix for output terraform files eg <customer_name> like demotenancy
prefix=

# auth mechanism for OCI APIs - api_key,instance_principal,session_token
auth_mechanism=

#input config file for Python API communication with OCI eg /cd3user/tenancies/<prefix>/.config_files/<prefix>_config;
config_file=

# Leave it blank if you want single outdir or specify outdir_structure_file.properties containing directory structure for OCI services.
outdir_structure_file=

# IaC Tool to be configured - Terraform(specify terraform) or OpenTofu(specify tofu)
tf_or_tofu=tofu

#path to cd3 excel eg /cd3user/tenancies/<prefix>\CD3-Customer.xlsx
cd3file=

#specify create_resources to create new resources in OCI(greenfield workflow)
#specify export_resources to export resources from OCI(non-greenfield workflow)
workflow_type=create_resources

Parameter Description
Variable Description Example
outdir Path to output directory where terraform files will be generated /cd3user/tenancies/demo/terraform_files
prefix Prefix for output terraform files \
auth_mechanism Authentication Mechanism for OCI APIs api_key
config_file Python config file /cd3user/tenancies/demo/.config_files/_config
outdir_structure_file Parameter specifying single outdir or different for different services Blank or _outdir_structure_file.properties
tf_or_tofu IaC Tool to be configured - Terraform or OpenTofu terraform or tofu
cd3file Path to the Excel input file /cd3user/tenancies/demo/CD3demo.xlsx
workflow_type Create Resources in OCI or Export Resources from OCI create_resources or export_resources

Copy CD3 Excel File

  • While using the container launched using RM Stack, local path /cd3user/mount_path on the VM is mapped to /cd3user/tenancies inside the container. So the file can be copied at /cd3user/mount_path/<prefix> on the VM. Below is the sample command to copy the excel file from local system to container:
    scp -i <private key pushed to VM while creating stack> <path to excel file on local> cd3user@<Public/Private IP of the VM>:/cd3user/mount_path/<prefix>
    
    Note that cd3user can be used to connect to the VM because same key is pushed for opc as well as cd3user.