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.
Required IAM Policy
Predefined values are a feature of defined tags. To allow users to work with predefined values, use the same IAM policy for working with tag namespaces and tags. For more information, see Required Permissions for Working with Defined Tags.
If you're new to policies, see Getting Started with Policies and Common Policies. If you want to dig deeper into writing policies for groups or other IAM components, see Details for IAM without Identity Domains.
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:
- You define a list of predefined values for a tag key.
- 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.
- 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
You can enable cost-tracking when you create a tag key definition, or you can update an existing tag key definition to enable cost tracking. For more information on creating and updating tag key definition, see Creating a Tag Key Definition and Updating a Tag Key Definition.
Using the API
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.