From 92bd720c8f1fb31671d93ef243892c2c6d62d62a Mon Sep 17 00:00:00 2001 From: tr Date: Mon, 20 Jul 2020 08:17:18 +0200 Subject: [PATCH] Add a variable for data vsphere_tag depends_on --- main.tf | 6 ++++-- variables.tf | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index e9d700b..684b529 100644 --- a/main.tf +++ b/main.tf @@ -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.tag_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.tag_depends_on] } locals { diff --git a/variables.tf b/variables.tf index 0a50b8a..2988058 100644 --- a/variables.tf +++ b/variables.tf @@ -351,3 +351,9 @@ variable "vm_depends_on" { type = any default = null } + +variable "tag_depends_on" { + description = "Add any external depend on module here like tag_depends_on = [vsphere_tag.foo.id]" + type = any + default = null +}