Skip to content

Create and Manage Resources in OCI (Greenfield Workflow)

Execute setUpOCI Pipeline

Step 1:
Choose the appropriate CD3 Excel sheet template from Excel Templates. Fill the CD3 Excel with appropriate values.

Step 2:
Login to Jenkins URL with user created after initialization. On the dashboard, a folder with <prefix> name is present. Click on it. It has the corresponding setupoci pipeline and terraform_files folder.

Click on the setupoci pipeline and select Build with Parameters from left side menu.

Screenshot 2024-01-16 at 10 56 42 AM

Note

Only one user at a time using the Jenkins setup is supported in the current release of the toolkit.

Step 3:
Upload the above filled Excel sheet in Excel_Template section.

Screenshot 2024-01-16 at 11 04 47 AM

Info

This will copy the Excel file at /cd3user/tenancies/<prefix> inside the container. It will also take backup of existing Excel on the container by appending the current datetime if same filename is uploaded in multiple executions.

Step 4:
Select the workflow as Create New Resources in OCI(Greenfield Workflow). Choose single or multiple MainOptions as required and then corresponding SubOptions.
Check out this while selecting multiple options simultaneously.
Below screenshot shows creation of Compartments (under Identity) and Tags (under Governance).

Screenshot 2024-01-17 at 12 04 15 PM

Click on Build at the bottom.

Step 5:
setUpOCI pipeline is triggered and stages are executed as shown below.
This will run the python script to generate the auto.tfvars. Once created, it will commit to the OCI Devops GIT Repo and then it will also launch apply pipelines for the services chosen (Stage:ashburn/identity and Stage:ashburn/tagging in the below screenshot).

Screenshot 2024-01-17 at 11 57 14 AM

Execute terraform/tofu Pipelines

Terraform/tofu pipelines are auto triggered parallely from setupoci pipeline based on the services selected (shown in the last two stages of the above screenshot).

Step 1:

Click on 'Logs' for Stage: ashburn/identity and click on the pipeline link. Screenshot 2024-01-17 at 11 58 15 AM

Note - Navigating to Dashboard displays pipelines that are in running state at the bottom left corner.
Or you can also navigate from Dashboard using the region based view (Dashboard → prefix → ashburn View → service specific pipeline)

In this example it would be:
cd3toolkit-demo » terraform_files » ashburn » identity » apply
cd3toolkit-demo » terraform_files » ashburn » tagging » apply

Step 2:
Stages of the terraform/tofu pipeline for apply are shown below:

Screenshot 2024-01-17 at 12 01 42 PM

Step 3:
Review Logs for Plan and OPA stages by clicking on the stage and then 'Logs'.

Screenshot 2024-01-17 at 12 13 57 PM

Step 4:
'Get Approval' stage has timeout of 24 hours, if no action is taken the pipeline will be aborted after 24 hours. Click on this stage and click 'Proceed' to proceed with apply or 'Abort' to cancel the apply.

Screenshot 2024-01-17 at 12 04 15 PM

Step 5:
Below screenshot shows Stage View after clicking on 'Proceed'. Login to the OCI console and verify that resources got created as required.

Screenshot 2024-01-17 at 12 13 15 PM

Step 6:
Similarly click on 'Logs' for Stage: ashburn/tagging and click on the pipeline link and 'Proceed' or 'Abort' the apply