label

cloudposse/label/null

Terraform Module HCL NULL

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes])

Install
module "label" {
source = "cloudposse/label/null"
version = "0.25.0"
}
plain text: /constructs/tfmod-cloudposse-label-null/install.txt
⭐ Source on GitHub 📦 Registry page
README

terraform-null-label ![Latest Release](https://github.com/cloudposse/terraform-null-label/releases/latest) ![Slack Community](https://slack.cloudposse.com) [![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

Inputs (18)
NameTypeDescriptionDefault
environmentstringID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'st required
delimiterstringDelimiter to be used between ID elements. Defaults to `-` (hyphen). Set to `""` required
label_key_casestringControls the letter case of the `tags` keys (label names) for tags generated by required
namespacestringID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp' required
stagestringID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'bu required
namestringID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thi required
label_orderlist(string)The order in which the labels (ID elements) appear in the `id`. Defaults to ["na required
regex_replace_charsstringTerraform regular expression (regex) string. Characters matching the regex will required
label_value_casestringControls the letter case of ID elements (labels) as included in `id`, set as tag required
enabledboolSet to false to prevent the module from creating any resources required
id_length_limitnumberLimit `id` to this many characters (minimum 6). Set to `0` for unlimited length. required
tenantstringID element _(Rarely used, not included by default)_. A customer identifier, indi required
attributeslist(string)ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, []
labels_as_tagsset(string)Set of labels (ID elements) to include as tags in the `tags` output. Default is [ "default" ]
tagsmap(string)Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`). Neither the tag keys nor the t{}
additional_tag_mapmap(string)Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not add{}
contextanySingle object for setting entire context at once. See description of individual { "additional_tag_map": {}, "attribu
descriptor_formatsanyDescribe additional descriptors to be output in the `descriptors` output map. Ma{}
Outputs (19)
id — Disambiguated ID string restricted to `id_length_limit` characters in total
name — Normalized name
tags — Normalized Tag map
additional_tag_map — The merged additional_tag_map
enabled — True if module is enabled, false otherwise
environment — Normalized environment
stage — Normalized stage
attributes — List of attributes
id_length_limit — The id_length_limit actually used to create the ID, with `0` meaning unlimited
tags_as_list_of_maps — This is a list with one map for each `tag`. Each map contains the tag `key`, `value`, and contents o
descriptors — Map of descriptors as configured by `descriptor_formats`
tenant — Normalized tenant
delimiter — Delimiter between `namespace`, `tenant`, `environment`, `stage`, `name` and `attributes`
label_order — The naming order actually used to create the ID
regex_replace_chars — The regex_replace_chars actually used to create the ID
id_full — ID string not restricted in length
namespace — Normalized namespace
normalized_context — Normalized context of this module
context — Merged but otherwise unmodified input to this module, to be used as context input to other modules.
Details
FrameworkTerraform Module
LanguageHCL
Version0.25.0
Cloud NULL
★ Stars702
Forks319
Total downloads183.8M
Inputs18
Outputs19
Examples3
LicenseApache-2.0
Namespacecloudposse
Updated