Tagging a subnet

You can use the following methods to add tags to a subnet.

Using tags enables you to define keys and values and associate them with resources. You can apply tags to your subnets to help you organize them according to your business needs. Apply tags at the time you create a subnet, or update the subnet with tags later. For more information, see Resource Tags.

Note

If you are not sure whether to apply tags, ask your administrator for guidance.
    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. Click the subnet you're interested in.
    4. Click the Tags tab to view or edit the existing tags. Or click Apply tag(s) to add new ones.
  • Use the network vcn create command and parameters shown to add tags when you create a subnet:

    oci network subnet create --compartment-id compartment_id [. . .] [--defined-tags | --freeform-tags] tags [OPTIONS]

    Use the network vcn update command and parameters shown to add tags to an existing subnet:

    oci network subnet update --subnet-id ocid [. . .] [--defined-tags | --freeform-tags] tags [OPTIONS] 

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

  • Run the CreateSubnet operation to to add tags when you create a subnet, and use the definedTags attribute.

    Run the UpdateSubnet operation to add tags when you update a subnet, and use the definedTags or freeformTags attributes.