label
cloudposse/label/null
Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes])
terraform-null-label   [![README Header][readme_header_img]][readme_header_link] [![Cloud Posse][logo]](https://cpco.io/homepage) Terraform module designed to generate consistent names and tags for resources. Use terraform-null-label to implement a strict naming convention. There are 6 inputs considered "labels" or "ID elements" (because the labels are used to construct the ID): 1. namespace 1. tenant 1. environment 1. stage 1. name 1. attributes This module generates IDs using the following convention by default: {namespace}-{environment}-{stage}-{name}-{attributes}. However, it is highly configurable. The delimiter (e.g. -) is configurable. Each label item
| Name | Type | Description | Default |
|---|---|---|---|
| environment | string | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'st | required |
| delimiter | string | Delimiter to be used between ID elements. Defaults to `-` (hyphen). Set to `""` | required |
| label_key_case | string | Controls the letter case of the `tags` keys (label names) for tags generated by | required |
| namespace | string | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp' | required |
| stage | string | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'bu | required |
| name | string | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thi | required |
| label_order | list(string) | The order in which the labels (ID elements) appear in the `id`. Defaults to ["na | required |
| regex_replace_chars | string | Terraform regular expression (regex) string. Characters matching the regex will | required |
| label_value_case | string | Controls the letter case of ID elements (labels) as included in `id`, set as tag | required |
| enabled | bool | Set to false to prevent the module from creating any resources | required |
| id_length_limit | number | Limit `id` to this many characters (minimum 6). Set to `0` for unlimited length. | required |
| tenant | string | ID element _(Rarely used, not included by default)_. A customer identifier, indi | required |
| attributes | list(string) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, | [] |
| labels_as_tags | set(string) | Set of labels (ID elements) to include as tags in the `tags` output. Default is | [
"default"
] |
| tags | map(string) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`). Neither the tag keys nor the t | {} |
| additional_tag_map | map(string) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not add | {} |
| context | any | Single object for setting entire context at once. See description of individual | {
"additional_tag_map": {},
"attribu |
| descriptor_formats | any | Describe additional descriptors to be output in the `descriptors` output map. Ma | {} |
id — Disambiguated ID string restricted to `id_length_limit` characters in totalname — Normalized nametags — Normalized Tag mapadditional_tag_map — The merged additional_tag_mapenabled — True if module is enabled, false otherwiseenvironment — Normalized environmentstage — Normalized stageattributes — List of attributesid_length_limit — The id_length_limit actually used to create the ID, with `0` meaning unlimitedtags_as_list_of_maps — This is a list with one map for each `tag`. Each map contains the tag `key`,
`value`, and contents odescriptors — Map of descriptors as configured by `descriptor_formats`tenant — Normalized tenantdelimiter — Delimiter between `namespace`, `tenant`, `environment`, `stage`, `name` and `attributes`label_order — The naming order actually used to create the IDregex_replace_chars — The regex_replace_chars actually used to create the IDid_full — ID string not restricted in lengthnamespace — Normalized namespacenormalized_context — Normalized context of this modulecontext — Merged but otherwise unmodified input to this module, to be used as context input to other modules.