# dokploy_tag (Resource)

A label that a project carries. Assign it with `tag_ids` on `dokploy_project`. The Dokploy UI filters the project list by tag.

~> Tag names are unique in the organization. A second tag with the same name fails on apply with the database error that Dokploy returns.

## Example Usage

```terraform
resource "dokploy_tag" "production" {
  name  = "production"
  color = "#0a8a74"
}

# A tag without a colour.
resource "dokploy_tag" "internal" {
  name = "internal"
}

# A project carries a set of tags; the provider replaces the whole set on
# each change.
resource "dokploy_project" "site" {
  name    = "site"
  tag_ids = [dokploy_tag.production.id, dokploy_tag.internal.id]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Display name, unique in the organization. Dokploy rejects an empty name.

### Optional

- `color` (String) Colour of the label in the Dokploy UI, as a CSS colour such as `#0a8a74`. Dokploy stores the string as is and does not validate it. Omit the attribute for no colour; an empty string is rejected at plan time, because Dokploy would store it and the provider reads it back as null.

### Read-Only

- `created_at` (String) Creation timestamp from the server.
- `id` (String) Tag id.
- `organization_id` (String) Id of the organization that owns the tag. The provider fills it from the API key's active organization.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import dokploy_tag.production LPSgSJ1Jyxlu0CvEnOfyp
```