Terraform
Create and manage reserved tag keys
This topic describes how to create and manage reserved tag keys in HCP Terraform. You can use reserved tag keys to help managers consistently label workspaces and projects in your organization.
Introduction
You can define reserved tag keys that appear as suggested labels when managers want to add tags to their projects and workspaces in the organization. Doing so helps you standardize tag keys and prevent duplicates that affect your ability to track resources.
Refer to the following topics for information about creating and managing tags attached to projects and workspaces:
Requirements
The admin permission preset must be enabled on your profile to create and manage reserved tags. Refer to Permissions for additional information.
Define a reserved tag key
You can define reserved tag keys for your organization so that project and workspace managers can use consistent labels.
- Sign in to HCP Terraform or Terraform Enterprise and navigate to the organization you want to define a reserved tag for.
- Choose Settings from the sidebar, then Tags.
- Click on the Reserved Keys tab.
- Click New reserved tag key and specify a key value when prompted. Keys are unique and can have up to 128 characters. You can use letters, numbers, spaces, and the following special characters:
.
,=
,+
,-
,@
,:
,-
, and_
. - You can enable the Disable overrides option to prevent project and workspace managers from overriding the key. Refer to Disable overrides for project tags for additional information.
- Click Save to finish adding the key.
Delete a reserved key
- Sign in to HCP Terraform or Terraform Enterprise and navigate to the organization where you want to delete a reserved tag.
- Choose Settings from the sidebar, then Tags.
- Click on the Reserved Keys tab.
- Open the ellipses menu and choose Delete <key-name>.
- Click Yes, delete reserved key when prompted.
To re-add a key, you must manually complete the steps described in Define a reserved tag key.
Edit a reserved key
- Sign in to HCP Terraform or Terraform Enterprise and navigate to the organization where you want to edit a reserved tag.
- Choose Settings from the sidebar, then Tags.
- Click on the Reserved Keys tab.
- Open the ellipses menu and choose Edit <key-name>.
- Specify your changes and click Save.
Disable overrides for project tags
Enable the Disable overrides option when creating or editing a reserved tag key to prevent project and workspace managers from overriding the tag keys.
This option is not retroactive. When a workspace contains keys that were overridden before you enabled the Disable overrides option, you must first remove the tags from the workspace. You can then re-apply the keys to the workspace so that HCP Terraform can allow future updates to the workspace tag bindings.