OCI ‐ Lab 1 ‐ Compartment - sayan028/Sayan-Chakraborty-OCI GitHub Wiki

Meaning of Compartment in OCI

In Oracle Cloud Infrastructure (OCI), a Compartment is a logical container used to organize and manage cloud resources within a tenancy.

Think of a compartment like a folder inside our OCI tenancy. We can place related resources together and control who can access and manage those resources.

Simple Example

Suppose ABC Technologies has one OCI tenancy:

           OCI TENANCY/ROOT
                  │
        APPLICATION COMPARTMENT
      ┌───────────┼───────────┐
      │           │           │
  Development  Production   Testing
  Compartment  Compartment  Compartment

Why do we use Compartments?

  1. Organization - Helps us organize resources based on projects, departments, or environments.

  2. Access Control - We can use policies to control which users or groups can access resources in a compartment.

  3. Resource Management - Makes it easier to manage related resources together.

  4. Cost Tracking - Resources can be grouped into compartments to help with tracking and managing usage and costs.

How many layers can be created in a compartment?

We can create seven layers of compartments, including the root compartment.

How to create a Compartment in OCI

Click on the Burger menu/Nevegation menue

Click on Identity & Security

Click on Compartments

Click on the Root Name

Click on Create Compartments

Write the application name in the Name field and the company details in the Description field

Click on Create Compartment

Create two child compartments in the application compartment

Explanation of Child Compartments in OCI

In Oracle Cloud Infrastructure (OCI), child compartments are compartments created inside a parent compartment. They help you organize and manage cloud resources such as Compute Instances, Virtual Cloud Networks (VCNs), storage, and databases.