Moving a Subnet Between Compartments

Move a subnet in a Virtual Cloud Network (VCN) to a different compartment.

For more information, see Working with Compartments.

    1. On the Virtual Cloud Networks list page, find the VCN with the subnet that you want to move. If you need help finding the list page, see Listing VCNs.
    2. On the details page, perform one of the following actions depending on the option that you see:
      • Select the Subnets tab.
      • Scroll down to the table following the VCN details, which lists the subnets in the VCN.
    3. From the Actions menu Actions Menu for the subnet, select Move Resource.
    4. In the Move resource panel, select the destination compartment from the list.
    5. Select 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.