You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TanveeKhanDB edited this page Jul 14, 2026
·
12 revisions
Scenario: We have to create one compartment and two sub compartment in OCI with the help of Terracode by using modular approach.A modular Terraform approach is the recommended way to provision resources in Oracle Cloud Infrastructure (OCI) because it makes your code reusable, scalable, and easier to maintain.
Steps to create compartment by terraform code with Modular approch
S1. I have created on tamplate as terra_compartment_tamplate
S2. Providing OCID of our teanancy where going to create compartment.
S3. Terraform plan is working fine
terraform plan
S4. Succesfully creation of parent compartment which is Blinkit:
terraform apply
S5.Creating two child compartment under Blinkit
Blinkit_compute_and_storage
Blinkit_networking
How to distroy any specific services in OCI by Terraform.