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.
- Open the navigation menu , select Networking, and then select Virtual cloud networks.
- Click the name of the VCN you're interested in.
- Under Resources, click Network Security Groups.
- Click the to the right side of the NSG, and then select Move resource.
- Select the destination compartment from the list.
- 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.