vSphere tagging differs from other providers in that it allows multiple cardinality of their tag categories (aka same tag category can be assigned multiple times) and each tag name must exist prior to being applied to a resource.
This Terraform module will lookup details about provided vSphere tags, which includes maps to display human friendly tag names vs vmomi IDs.
Call the module given a map of existing tags to get their details.
Basic
module tag_lookup {
source = <path to module>
tags = {
environment = ["dev"]
point-of-contact = ["devops", "finance"]
}
separator = "="
}
No requirements.
Name | Version |
---|---|
vsphere | n/a |
No modules.
Name | Type |
---|---|
vsphere_tag.reference | data source |
vsphere_tag_category.reference | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
separator | (Optional) string character used to separate tag category and tag name | string |
"/" |
no |
tags | (Required) Tags to be discovered, format is map with tag category as key and list of strings as tag names | map(list(string)) |
n/a | yes |
Name | Description |
---|---|
details_map | Tag display name is key, value contains all other tag details. |
id_map | Tag ID is key, value contains all other tag details. |