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.

    1. Open the navigation menu, click Networking, and then click Virtual cloud networks.
    2. Click the name of the VCN that contains the subnet.
    3. Find the subnet in the Subnets list, click the Actions menu (Actions Menu) for it, and then select Move resource.
    4. Select the destination compartment from the list.
    5. 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.