Creating a Compartment
Create compartments in an IAM tenancy to organize and isolate your cloud resources.
If you belong to the Administrators group or if an administrator has created a policy that allows you to manage compartments, then you have the required access for creating compartments. Policies that manage compartments can be scoped to the tenancy level or to the compartment level.
When creating a compartment, you must provide a name for it that's unique within its parent compartment, with a maximum 100 characters, including letters, numbers, periods, hyphens, and underscores. You must also provide a description, which is a nonunique, changeable description for the compartment, from 1 to 400 characters. Oracle also assigns the compartment a unique ID called an Oracle Cloud ID (OCID). For more information, see Resource Identifiers.
You can create subcompartments in compartments to create hierarchies up are six levels deep, as shown in the following Console image.
You might also want to write a policy for the compartment. See Creating a Policy. Use the create command and required parameters to create a compartment:
oci iam compartment create [OPTIONS]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the CreateCompartment operation to create a compartment.