File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ resource "vsphere_tag_category" "category" {
2+ name = " terraform-test-category"
3+ cardinality = " SINGLE"
4+ description = " Managed by Terraform"
5+
6+ associable_types = [
7+ " VirtualMachine" ,
8+ " Datastore" ,
9+ ]
10+ }
11+
12+ resource "vsphere_tag" "tag" {
13+ name = " terraform-test-tag"
14+ category_id = " ${ vsphere_tag_category . category . id } "
15+ description = " Managed by Terraform"
16+ }
17+
118variable "vm" {
219 type = map (object ({
320 vmname = string
@@ -7,6 +24,7 @@ variable "vm" {
724 vmfolder = string
825 datastore = string
926 is_windows_image = bool
27+ tags = map (string )
1028 instances = number
1129 network = map (list (string ))
1230 vmgateway = string
@@ -18,6 +36,8 @@ variable "vm" {
1836module "example-server-basic" {
1937 source = " ../../"
2038 for_each = var. vm
39+ tag_depends_on = [vsphere_tag . tag . id ]
40+ tags = each. value . tags
2141 vmtemp = each. value . vmtemp
2242 is_windows_image = each. value . is_windows_image
2343 instances = each. value . instances
You can’t perform that action at this time.
0 commit comments