Moving a Subnet to a Different Compartment
Move a subnet in a Virtual Cloud Network (VCN) to a different compartment.
For more information, see Working with Compartments.
- Open the navigation menu, click Networking, and then click Virtual cloud networks.
- Click the name of the VCN that contains the subnet.
- Find the subnet in the Subnets list, click the for it, and then select Move resource.
- Select the destination compartment from the list.
- Click Move resource.
Use the network subnet change-compartment command and required parameters to move a subnet from one compartment to another:
oci network subnet change-compartment --compartment-id destination-compartment-ocid--subnet-id ocid ... [OPTIONS]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the ChangeSubnetCompartment operation to move a subnet from one compartment to another.