An open API service indexing awesome lists of open source software.

https://github.com/terraform-hc-modules/terraform-hcloud-labels

Terraform module for consistent labeling and naming conventions in Hetzner Cloud
https://github.com/terraform-hc-modules/terraform-hcloud-labels

hcloud hetzner labels terraform terraform-module

Last synced: 2 months ago
JSON representation

Terraform module for consistent labeling and naming conventions in Hetzner Cloud

Awesome Lists containing this project

README

          

# Hetzner Cloud Labels Module

Terraform module to generate consistent naming and labeling for Hetzner Cloud resources.

## Usage

```hcl
module "labels" {
source = "terraform-hc-modules/labels/hcloud"
version = "~> 0.1"

name = "web-server"
environment = "production"
project = "myapp"
owner = "platform-team"
}

# Use outputs
resource "hcloud_server" "this" {
name = module.labels.id # "production-web-server"
server_type = "cx22"
image = "ubuntu-24.04"
labels = module.labels.labels # { name = "web-server", environment = "production", ... }
}
```

## Examples

- [Basic](examples/basic) - Simple usage
- [Complete](examples/complete) - All features

## Requirements

| Name | Version |
| ---- | ------- |
| [terraform](#requirement\_terraform) | >= 1.5.0 |
| [terraform](#requirement\_terraform) | >= 1.0 |
| [hcloud](#requirement\_hcloud) | >= 1.49.0 |

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| [delimiter](#input\_delimiter) | Delimiter between labels in the generated ID. | `string` | `"-"` | no |
| [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources. | `bool` | `true` | no |
| [environment](#input\_environment) | Environment name (e.g., dev, staging, prod). | `string` | `""` | no |
| [extra\_labels](#input\_extra\_labels) | Additional labels to merge with generated labels. | `map(string)` | `{}` | no |
| [label\_order](#input\_label\_order) | Order of labels to include in the generated ID. | `list(string)` |

[
"environment",
"name"
]
| no |
| [managed\_by](#input\_managed\_by) | Tool managing this resource. | `string` | `"terraform"` | no |
| [name](#input\_name) | Name of the resource. | `string` | `""` | no |
| [owner](#input\_owner) | Owner of the resource (team or individual). | `string` | `""` | no |
| [project](#input\_project) | Project or application name. | `string` | `""` | no |

## Outputs

| Name | Description |
| ---- | ----------- |
| [enabled](#output\_enabled) | Whether the module is enabled. |
| [environment](#output\_environment) | The environment input. |
| [id](#output\_id) | Generated ID based on label\_order. |
| [labels](#output\_labels) | Map of labels for use with hcloud resources. |
| [labels\_as\_list](#output\_labels\_as\_list) | Labels as a list of key-value objects. |
| [managed\_by](#output\_managed\_by) | The managed\_by input. |
| [name](#output\_name) | The name input. |
| [owner](#output\_owner) | The owner input. |
| [project](#output\_project) | The project input. |

## License

Mozilla Public License 2.0 - see [LICENSE](LICENSE)