Creating a Tag Key Definition
Learn how to create a tag key definition on a Roving Edge device.
Create a tag key definition within a tag namespace.
A tag namespace can have at most 100 tag key definitions.
Tag key names have the following characteristics:
-
Must be unique within the tenancy.
The same tag key name can be used in different tag namespaces.
-
Are case insensitive.
-
Cannot be changed later.
-
Can be no more than 100 characters.
-
Cannot contain period (.) or space characters.
The tag key description can be no more than 256 characters.
-
In the navigation menu, select Governance, and then select Tag Namespaces.
If the tag namespace where you want to add the tag key definition is not listed, use the Compartment drop-down menu above the tag namespaces list to select the correct compartment.
-
Select the name of the tag namespace where you want to add a tag key definition.
-
On the tag namespace details page, scroll down to the Resources section and select Tag Key Definitions.
-
Select the Create Tag Key Definition button.
-
In the Create Tag Key Definition dialog box, enter the following information:
-
Name: A name for this tag key. See the preceding list of characteristics.
-
Description: A description for this tag key definition.
-
-
Select the Tag Value Type.
-
Static Value: Not populated. The user must enter a value when the tag is applied to a resource. This is the default selection.
-
A List of Values: A predefined list of values. Enter at least one value. The user must select one of these predefined values to apply to a resource.
Separate multiple values with new lines. Duplicate values and blank lines are invalid. Values are case sensitive and can be no more than 256 characters.
A value can include one of the following variables:
${iam.principal.name}- The name of the user that tagged the resource.
${iam.principal.type}- The type of principal that tagged the resource. One of: root user, IAM user, or Instance principal.
${oci.datetime}- The date and time that the tag was created.
-
-
Select the Create Tag Key Definition button in the dialog box.
The details page for the new tag key definition is displayed.
-
Use the oci iam tag create command and required parameters to create a new tag key definition.
Example for a static value (the default):
oci iam tag create --tag-namespace-id tag_namespace_OCID --name text --description "text"The following command creates a tag key definition with a list of values from which the user must select when applying the tag.
oci iam tag create --tag-namespace-id tag_namespace_OCID --name text --description "text" --validator valuesThe value of the
--validatoroption argument is a JSON definition of the tag values. This JSON definition can be provided as a string on the command line or in a file.The following command displays a template of the correct JSON to provide:
oci iam tag create --generate-param-json-input validatorExample parameter for a list of values:
--validator '{"validator-type": "ENUM", "values": ["typeA","typeB","typeC"]}'For a complete list of CLI commands, flags, and options, see the Command Line Reference.
Use the CreateTag operation to create a new tag key definition.
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.