Moving an NSG to a Different Compartment

Move a network security group (NSG) in a virtual cloud network (VCN) between compartments.

When you move an NSG to a new compartment, inherent policies apply immediately.

For more information about using compartments and policies to control access to resources in your cloud network, see Access Control. For general information about compartments, see Managing Compartments.

    1. Open the navigation menu, click Networking, and then click Virtual cloud networks.
    2. Click the name of the VCN you're interested in.
    3. Under Resources, click Network Security Groups.
    4. Click the Actions menu (Actions Menu) to the right side of the NSG, and then select Move resource.
    5. Select the destination compartment from the list.
    6. Click Move resource.
  • Use the network nsg change-compartment command and required parameters to move an NSG from one compartment to another:

    oci network nsg change-compartment --compartment-id destination-compartment-ocid --nsg-id nsg-ocid ... [OPTIONS]

    For a complete list of flags and variable options for CLI commands, see the CLI Command Reference.

  • Run the ChangeNetworkSecurityGroupCompartment operation to move an NSG from one compartment to another.