# Resource Tags

Organize your Network using tags.

Tags are pieces of metadata that you can attach to your [Resources](/content/docs/resources/index.html). You can use tags to:

- Add context to each of your Resources, like what team it belongs to or what application it runs.
- Filter Resources by their tags for quick and efficient searching.

Tags let you organize your Network by labeling your Resources with attributes relevant to the Resource beyond just their name and address. You can add custom information about a Resource such as its owner, purpose, or location. Using tags to filter Resources is the fastest way to find a specific set of Resources.

## [overview permalink](/content/docs/tags#overview/index.html) Overview

Each tag is a key-value pair. **Tag keys** indicate what the tag represents, e.g. `owner` or `environment`. **Tag values** represent specific information associated with the key, e.g. `devops` or `production`.

### [tag requirements permalink](/content/docs/tags#tag-requirements/index.html) Tag requirements

- Each Resource can have at most 64 tags.
- Each Resource can only have one tag with a given key, e.g. a Resource can’t have two tags with the `owner` key.
- Both tag keys and values are case-sensitive.
- Both tag keys and values may consist of any valid UTF-8 character.
- Both tag keys and values cannot start or end with whitespace. When adding a tag, any leading or trailing whitespace is automatically removed.
- Keys cannot start with `tg`, e.g. `tg_remote_network` is a prohibited tag key.
- Keys must be at least 1 character and no more than 128 characters.
- Values must be at least 1 character and no more than 256 characters.

## [using tags permalink](/content/docs/tags#using-tags/index.html) Using tags

Tags are flexible and let you categorize your Resources in ways that work for you. As an example, you could use tags to track each Resource’s owner and purpose, making it easy to know who to reach out to when there are problems with a Resource or what each Resource does.

### [best practices permalink](/content/docs/tags#best-practices/index.html) Best practices

- **Use a consistent set of tags** across all of your Resources. Use tags with standardized keys across your Resources to organize them in a structured, uniform way. Instead of mixing tags like `owner` and `owner-team`, align on which keys to use within your Network.
- **Tag all your Resources** to keep your Network organized. Tags are most useful when all of your Resources are using them.
- **Use tags for various contexts** like technical information, ownership, or security requirements. Tags can be used to track a wide variety of context, all of which can be useful to organize your Network.

### [common tags permalink](/content/docs/tags#common-tags/index.html) Common tags

While there are many possible things you could track with tags, these are some common tags that are useful in most Networks.

**Ownership**

- `owner`: who owns this resource, e.g. `devops`, `it-team`, or `alex@autoco.example`.
- `managed_by`: the system used to manage this Resource, e.g. `admin_console`, `terraform`, `pulumi`, or `k8s_operator`.

**Technical information**

- `application`: the application running on this Resource, e.g. `prometheus`, `kafka`, `proxmox`, or anything else.
- `environment`: an environment, e.g. `development`, `staging`, or `production`.
- `location`: a physical or virtual location, e.g. `sf-office` or `us-west-2`.
- `region`: a virtual location within your cloud provider, e.g. `us-west-2` or `eu-central-1`.

Of course, you’re not limited to just the examples here. Use tags for anything that’s useful for classifying Resources and organizing your Network.

## [managing tags permalink](/content/docs/tags#managing-tags/index.html) Managing tags

Tags can be managed from the Admin Console or the [API](/content/docs/tags#using-the-api-and-terraform/index.html). When creating or editing a Resource, you can add new tags by clicking on the _Add Tag_ button.

Adding tags via the Resource modal

To add a new tag, first set its key and then set its value. As you type keys and values, Twingate will suggest keys and values from other tags in your Network. Any tags that you add will be saved when you save the Resource.

Continue to add tags as needed. You can only edit a tag’s key or value when creating the tag. If needed, you can remove a tag by clicking on the ✕ remove icon to the right of a tag.

A Resource with multiple tags

## [filtering resources using tags permalink](/content/docs/tags#filtering-resources-using-tags/index.html) Filtering Resources using tags

In the Admin Console, navigate to _Network_ → _Resources_. From the Resource table, you can use the _Tags_ filter to show Resources that only match a specific set of tags.

The tags filter

To add tags to the filter, select _Select Key_ and search for the key you want to use. Then, decide whether to filter for a list of values to include ( _in_) or exclude ( _not in_). From there, search for all of the tag values you want to use in the filter.

An example filter

## [using the api and terraform permalink](/content/docs/tags#using-the-api-and-terraform/index.html) Using the API and Terraform

Tags can be managed from the [Twingate API](/content/docs/api-overview/index.html) and will soon be supported in [Terraform](https://registry.terraform.io/providers/Twingate/twingate/latest/docs), [Pulumi](https://www.pulumi.com/registry/packages/twingate/), and the [Kubernetes operator](https://github.com/twingate/kubernetes-operator).

Using the API and its integration, you can manage your tags at scale. In particular, with Terraform and Pulumi, you can import tags from your cloud provider. This ensures that whatever context you have in AWS or GCP gets reflected within Twingate.

Last updated 5 months ago
