Skip to content

Commit

Permalink
Merge pull request #30 from keachi/tag_depend
Browse files Browse the repository at this point in the history
Depends on vm_depend before get data tag
  • Loading branch information
Arman-Keyoumarsi authored Jul 7, 2020
2 parents 8cfd3e3 + df6ea90 commit 406d8c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ data "vsphere_virtual_machine" "template" {
}

data "vsphere_tag_category" "category" {
count = var.tags != null ? length(var.tags) : 0
name = keys(var.tags)[count.index]
count = var.tags != null ? length(var.tags) : 0
name = keys(var.tags)[count.index]
depends_on = [var.vm_depends_on]
}

data "vsphere_tag" "tag" {
count = var.tags != null ? length(var.tags) : 0
name = var.tags[keys(var.tags)[count.index]]
category_id = "${data.vsphere_tag_category.category[count.index].id}"
depends_on = [var.vm_depends_on]
}

locals {
Expand Down

0 comments on commit 406d8c3

Please sign in to comment.