Moving a NAT Gateway to a Different Compartment

Move a NAT gateway into a different compartment within the same tenancy.

You can move a NAT gateway from one compartment to another. When you move a NAT gateway to a new compartment, inherent policies apply immediately.

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

    1. On the Virtual Cloud Networks list page, select the VCN that contains the gateway that you want to work with. If you need help finding the list page or the VCN, see Listing VCNs.
    2. On the details page, perform one of the following actions depending on the option that you see:
      • On the Gateways tab, go to the NAT Gateways section.
      • Under Resources, select NAT Gateways.
    3. Select the the Actions menu (three dots) for the gateway, and then select Move Resource.
    4. In the Move resource panel, select the destination compartment from the list.
    5. Select Move resource.
  • Use the network nat-gateway change-compartment command and required parameters to move a NAT gateway:

    oci network nat-gateway change-compartment --compartment-id new-compartment-ocid --nat-gateway-id nat-ocid ... [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the ChangeNatGatewayCompartment operation to move a NAT gateway.