Using Predefined Values

You can create a list of values and associate that list with a tag key definition. When users then apply the tag to a resource, they must select a value from the list of predefined values. Use lists of predefined values to impose limits on the values that users can apply to tags.

You can use predefined values with defined tags and default tags. You cannot create lists of predefined values for free-form tags.

Working with Predefined Values

You can update existing tags to use predefined values.

Every list of predefined values that you create must contain at least one value. Lists can't contain duplicate values or blank entries. With predefined values, users applying tags can't set the value of a tag to null. For more information, see Using the Console.

Predefined Values and Default Tags

You can use predefined values and default tags to impose limits on the values that users can apply to tags.

Here's how it works:

  1. You define a list of predefined values for a tag key.
  2. You create a default tag that uses the key with the list of predefined values and requires that users who create resources in the compartment add the value to the tag.
  3. Oracle prompts all users creating resources in the compartment to enter a tag value. Because the tag key contains a predefined list that you created, the value the user applies is a value that you trust.

These features help to ensure that new resources contain the values you expect. For more information, see Managing Tag Defaults.

Using the Console

Caution

Avoid entering confidential information when assigning descriptions, tags, or friendly names to your cloud resources through the Oracle Cloud Infrastructure Console, API, or CLI.
To create a key definition
  1. Open the navigation menu. Under Governance and Administration, go to Governance and click Tag Namespaces.

    A list of the tag namespaces in your current compartment is displayed.

  2. Click the tag namespace you want to add the tag key definition to.

    A list of the tag key definitions that belong to the namespace is displayed.

  3. Click Create Tag Key Definition.
  4. Enter the following:
    • Tag Key: Enter the key. The key can be up to 100 characters in length. Tag keys are case insensitive and must be unique within the tag namespace.
    • Description: Enter a friendly description.
    • Cost-tracking: Select the check box to enable this tag for cost tracking. You have a limit of 10 Using Cost-Tracking Tags in your tenancy.
  5. Under Tag Value Type, choose one of the following:
    • Static Value: Specifies that the user applying the tag can specify any value for this key.
    • A List of Values: Specifies that the user must apply a value from a list you create. When you select this option, the Values box appears. Type the values from which the user can select. Separate multiple values with new lines. You must have at least one value. You can't have blank lines or duplicate values.
  6. Click Create Tag Key Definition.
To update a tag key definition
  1. Open the navigation menu. Under Governance and Administration, go to Governance and click Tag Namespaces.

    A list of the tag namespaces in your current compartment is displayed.

  2. Click the tag namespace that includes the tag key definition you want to update.

    A list of the tag key definitions is displayed.

  3. Click the tag key definition you want to update.

    The key definition's details are displayed.

  4. Click Edit Tag Key Definition.

    The edit dialog appears.

    You can change the description, the tag value type, and enable or disable cost tracking.

    If you chose a list of values, the Values box appears, and you must add at least one value. You can't have blank lines or duplicate values in the Values box.

    You have a limit of 10 Using Cost-Tracking Tags in your tenancy.

  5. Make your changes and save it.